// Copyright 2016 The Chromium Embedded Framework Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. #ifndef CEF_LIBCEF_BROWSER_VIEWS_BOX_LAYOUT_IMPL_H_ #define CEF_LIBCEF_BROWSER_VIEWS_BOX_LAYOUT_IMPL_H_ #pragma once #include "include/views/cef_box_layout.h" #include "libcef/browser/views/layout_impl.h" #include "ui/views/layout/box_layout.h" class CefBoxLayoutImpl : public CefLayoutImpl { public: // Necessary for the CEF_REQUIRE_VALID_*() macros to compile. using ParentClass = CefLayoutImpl; CefBoxLayoutImpl(const CefBoxLayoutImpl&) = delete; CefBoxLayoutImpl& operator=(const CefBoxLayoutImpl&) = delete; // Create a new CefBoxLayout insance. |owner_view| must be non-nullptr. static CefRefPtr Create( const CefBoxLayoutSettings& settings, views::View* owner_view); // CefBoxLayout methods: void SetFlexForView(CefRefPtr view, int flex) override; void ClearFlexForView(CefRefPtr view) override; // CefLayout methods: CefRefPtr AsBoxLayout() override { return this; } private: explicit CefBoxLayoutImpl(const CefBoxLayoutSettings& settings); views::BoxLayout* CreateLayout() override; CefBoxLayoutSettings settings_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBoxLayoutImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BOX_LAYOUT_IMPL_H_