• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Embedded Framework Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be found
3 // in the LICENSE file.
4 
5 #include "libcef/browser/views/basic_panel_impl.h"
6 
7 #include "libcef/browser/views/basic_panel_view.h"
8 
9 // static
CreatePanel(CefRefPtr<CefPanelDelegate> delegate)10 CefRefPtr<CefPanel> CefPanel::CreatePanel(
11     CefRefPtr<CefPanelDelegate> delegate) {
12   return CefBasicPanelImpl::Create(delegate);
13 }
14 
15 // static
Create(CefRefPtr<CefPanelDelegate> delegate)16 CefRefPtr<CefBasicPanelImpl> CefBasicPanelImpl::Create(
17     CefRefPtr<CefPanelDelegate> delegate) {
18   CEF_REQUIRE_UIT_RETURN(nullptr);
19   CefRefPtr<CefBasicPanelImpl> panel = new CefBasicPanelImpl(delegate);
20   panel->Initialize();
21   return panel;
22 }
23 
CefBasicPanelImpl(CefRefPtr<CefPanelDelegate> delegate)24 CefBasicPanelImpl::CefBasicPanelImpl(CefRefPtr<CefPanelDelegate> delegate)
25     : ParentClass(delegate) {}
26 
CreateRootView()27 views::View* CefBasicPanelImpl::CreateRootView() {
28   return new CefBasicPanelView(delegate());
29 }
30 
InitializeRootView()31 void CefBasicPanelImpl::InitializeRootView() {
32   static_cast<CefBasicPanelView*>(root_view())->Initialize();
33 }
34