• 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 #ifndef CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_IMPL_H_
6 #define CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_IMPL_H_
7 #pragma once
8 
9 #include "include/views/cef_panel.h"
10 #include "include/views/cef_panel_delegate.h"
11 
12 #include "libcef/browser/views/panel_impl.h"
13 
14 #include "ui/views/view.h"
15 
16 class CefBasicPanelImpl
17     : public CefPanelImpl<views::View, CefPanel, CefPanelDelegate> {
18  public:
19   using ParentClass = CefPanelImpl<views::View, CefPanel, CefPanelDelegate>;
20 
21   CefBasicPanelImpl(const CefBasicPanelImpl&) = delete;
22   CefBasicPanelImpl& operator=(const CefBasicPanelImpl&) = delete;
23 
24   // Create a new CefPanel instance. |delegate| may be nullptr.
25   static CefRefPtr<CefBasicPanelImpl> Create(
26       CefRefPtr<CefPanelDelegate> delegate);
27 
28   // CefViewAdapter methods:
GetDebugType()29   std::string GetDebugType() override { return "Panel"; }
30 
31  private:
32   // Create a new implementation object.
33   // Always call Initialize() after creation.
34   // |delegate| may be nullptr.
35   explicit CefBasicPanelImpl(CefRefPtr<CefPanelDelegate> delegate);
36 
37   // CefViewImpl methods:
38   views::View* CreateRootView() override;
39   void InitializeRootView() override;
40 
41   IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBasicPanelImpl);
42 };
43 
44 #endif  // CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_IMPL_H_
45