• 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=147ef76bff631531a075ac9a2c823d3e9f84c409$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_EXTENSION_HANDLER_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_EXTENSION_HANDLER_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_client_capi.h"
24 #include "include/capi/cef_extension_handler_capi.h"
25 #include "include/cef_client.h"
26 #include "include/cef_extension_handler.h"
27 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
28 
29 // Wrap a C structure with a C++ class.
30 // This class may be instantiated and accessed DLL-side only.
31 class CefExtensionHandlerCToCpp
32     : public CefCToCppRefCounted<CefExtensionHandlerCToCpp,
33                                  CefExtensionHandler,
34                                  cef_extension_handler_t> {
35  public:
36   CefExtensionHandlerCToCpp();
37   virtual ~CefExtensionHandlerCToCpp();
38 
39   // CefExtensionHandler methods.
40   void OnExtensionLoadFailed(cef_errorcode_t result) override;
41   void OnExtensionLoaded(CefRefPtr<CefExtension> extension) override;
42   void OnExtensionUnloaded(CefRefPtr<CefExtension> extension) override;
43   bool OnBeforeBackgroundBrowser(CefRefPtr<CefExtension> extension,
44                                  const CefString& url,
45                                  CefRefPtr<CefClient>& client,
46                                  CefBrowserSettings& settings) override;
47   bool OnBeforeBrowser(CefRefPtr<CefExtension> extension,
48                        CefRefPtr<CefBrowser> browser,
49                        CefRefPtr<CefBrowser> active_browser,
50                        int index,
51                        const CefString& url,
52                        bool active,
53                        CefWindowInfo& windowInfo,
54                        CefRefPtr<CefClient>& client,
55                        CefBrowserSettings& settings) override;
56   CefRefPtr<CefBrowser> GetActiveBrowser(CefRefPtr<CefExtension> extension,
57                                          CefRefPtr<CefBrowser> browser,
58                                          bool include_incognito) override;
59   bool CanAccessBrowser(CefRefPtr<CefExtension> extension,
60                         CefRefPtr<CefBrowser> browser,
61                         bool include_incognito,
62                         CefRefPtr<CefBrowser> target_browser) override;
63   bool GetExtensionResource(
64       CefRefPtr<CefExtension> extension,
65       CefRefPtr<CefBrowser> browser,
66       const CefString& file,
67       CefRefPtr<CefGetExtensionResourceCallback> callback) override;
68 };
69 
70 #endif  // CEF_LIBCEF_DLL_CTOCPP_EXTENSION_HANDLER_CTOCPP_H_
71