• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=5aabb450064c183478e8cbcd7b96a9d308bc5c59$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
17 #pragma once
18 
19 #if !defined(BUILDING_CEF_SHARED)
20 #error This file can be included DLL-side only
21 #endif
22 
23 #include "include/capi/cef_browser_capi.h"
24 #include "include/capi/views/cef_browser_view_capi.h"
25 #include "include/capi/views/cef_browser_view_delegate_capi.h"
26 #include "include/cef_browser.h"
27 #include "include/views/cef_browser_view.h"
28 #include "include/views/cef_browser_view_delegate.h"
29 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
30 
31 // Wrap a C structure with a C++ class.
32 // This class may be instantiated and accessed DLL-side only.
33 class CefBrowserViewDelegateCToCpp
34     : public CefCToCppRefCounted<CefBrowserViewDelegateCToCpp,
35                                  CefBrowserViewDelegate,
36                                  cef_browser_view_delegate_t> {
37  public:
38   CefBrowserViewDelegateCToCpp();
39   virtual ~CefBrowserViewDelegateCToCpp();
40 
41   // CefBrowserViewDelegate methods.
42   void OnBrowserCreated(CefRefPtr<CefBrowserView> browser_view,
43                         CefRefPtr<CefBrowser> browser) override;
44   void OnBrowserDestroyed(CefRefPtr<CefBrowserView> browser_view,
45                           CefRefPtr<CefBrowser> browser) override;
46   CefRefPtr<CefBrowserViewDelegate> GetDelegateForPopupBrowserView(
47       CefRefPtr<CefBrowserView> browser_view,
48       const CefBrowserSettings& settings,
49       CefRefPtr<CefClient> client,
50       bool is_devtools) override;
51   bool OnPopupBrowserViewCreated(CefRefPtr<CefBrowserView> browser_view,
52                                  CefRefPtr<CefBrowserView> popup_browser_view,
53                                  bool is_devtools) override;
54   ChromeToolbarType GetChromeToolbarType() override;
55 
56   // CefViewDelegate methods.
57   CefSize GetPreferredSize(CefRefPtr<CefView> view) override;
58   CefSize GetMinimumSize(CefRefPtr<CefView> view) override;
59   CefSize GetMaximumSize(CefRefPtr<CefView> view) override;
60   int GetHeightForWidth(CefRefPtr<CefView> view, int width) override;
61   void OnParentViewChanged(CefRefPtr<CefView> view,
62                            bool added,
63                            CefRefPtr<CefView> parent) override;
64   void OnChildViewChanged(CefRefPtr<CefView> view,
65                           bool added,
66                           CefRefPtr<CefView> child) override;
67   void OnWindowChanged(CefRefPtr<CefView> view, bool added) override;
68   void OnLayoutChanged(CefRefPtr<CefView> view,
69                        const CefRect& new_bounds) override;
70   void OnFocus(CefRefPtr<CefView> view) override;
71   void OnBlur(CefRefPtr<CefView> view) override;
72 };
73 
74 #endif  // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
75