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 typedef CefPanelImpl<views::View, CefPanel, CefPanelDelegate> ParentClass; 20 21 // Create a new CefPanel instance. |delegate| may be nullptr. 22 static CefRefPtr<CefBasicPanelImpl> Create( 23 CefRefPtr<CefPanelDelegate> delegate); 24 25 // CefViewAdapter methods: GetDebugType()26 std::string GetDebugType() override { return "Panel"; } 27 28 private: 29 // Create a new implementation object. 30 // Always call Initialize() after creation. 31 // |delegate| may be nullptr. 32 explicit CefBasicPanelImpl(CefRefPtr<CefPanelDelegate> delegate); 33 34 // CefViewImpl methods: 35 views::View* CreateRootView() override; 36 void InitializeRootView() override; 37 38 IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBasicPanelImpl); 39 DISALLOW_COPY_AND_ASSIGN(CefBasicPanelImpl); 40 }; 41 42 #endif // CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_IMPL_H_ 43