2016-01-19 21:09:01 +01:00
|
|
|
// 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"
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
class CefBoxLayoutImpl : public CefLayoutImpl<views::BoxLayout, CefBoxLayout> {
|
2016-01-19 21:09:01 +01:00
|
|
|
public:
|
|
|
|
// Necessary for the CEF_REQUIRE_VALID_*() macros to compile.
|
2021-12-06 21:40:25 +01:00
|
|
|
using ParentClass = CefLayoutImpl<views::BoxLayout, CefBoxLayout>;
|
|
|
|
|
|
|
|
CefBoxLayoutImpl(const CefBoxLayoutImpl&) = delete;
|
|
|
|
CefBoxLayoutImpl& operator=(const CefBoxLayoutImpl&) = delete;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// Create a new CefBoxLayout insance. |owner_view| must be non-nullptr.
|
|
|
|
static CefRefPtr<CefBoxLayoutImpl> Create(
|
|
|
|
const CefBoxLayoutSettings& settings,
|
|
|
|
views::View* owner_view);
|
|
|
|
|
|
|
|
// CefBoxLayout methods:
|
|
|
|
void SetFlexForView(CefRefPtr<CefView> view, int flex) override;
|
|
|
|
void ClearFlexForView(CefRefPtr<CefView> view) override;
|
|
|
|
|
|
|
|
// CefLayout methods:
|
|
|
|
CefRefPtr<CefBoxLayout> 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_
|