• 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=2db5977714e59976ae9617a49a65cadb72623ebd$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_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_request_handler_capi.h"
24 #include "include/cef_request_handler.h"
25 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
26 
27 // Wrap a C structure with a C++ class.
28 // This class may be instantiated and accessed DLL-side only.
29 class CefRequestHandlerCToCpp
30     : public CefCToCppRefCounted<CefRequestHandlerCToCpp,
31                                  CefRequestHandler,
32                                  cef_request_handler_t> {
33  public:
34   CefRequestHandlerCToCpp();
35   virtual ~CefRequestHandlerCToCpp();
36 
37   // CefRequestHandler methods.
38   bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
39                       CefRefPtr<CefFrame> frame,
40                       CefRefPtr<CefRequest> request,
41                       bool user_gesture,
42                       bool is_redirect) override;
43   bool OnOpenURLFromTab(CefRefPtr<CefBrowser> browser,
44                         CefRefPtr<CefFrame> frame,
45                         const CefString& target_url,
46                         WindowOpenDisposition target_disposition,
47                         bool user_gesture) override;
48   CefRefPtr<CefResourceRequestHandler> GetResourceRequestHandler(
49       CefRefPtr<CefBrowser> browser,
50       CefRefPtr<CefFrame> frame,
51       CefRefPtr<CefRequest> request,
52       bool is_navigation,
53       bool is_download,
54       const CefString& request_initiator,
55       bool& disable_default_handling) override;
56   bool GetAuthCredentials(CefRefPtr<CefBrowser> browser,
57                           const CefString& origin_url,
58                           bool isProxy,
59                           const CefString& host,
60                           int port,
61                           const CefString& realm,
62                           const CefString& scheme,
63                           CefRefPtr<CefAuthCallback> callback) override;
64   bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
65                       const CefString& origin_url,
66                       int64 new_size,
67                       CefRefPtr<CefCallback> callback) override;
68   bool OnCertificateError(CefRefPtr<CefBrowser> browser,
69                           cef_errorcode_t cert_error,
70                           const CefString& request_url,
71                           CefRefPtr<CefSSLInfo> ssl_info,
72                           CefRefPtr<CefCallback> callback) override;
73   bool OnSelectClientCertificate(
74       CefRefPtr<CefBrowser> browser,
75       bool isProxy,
76       const CefString& host,
77       int port,
78       const X509CertificateList& certificates,
79       CefRefPtr<CefSelectClientCertificateCallback> callback) override;
80   void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
81                        const CefString& plugin_path) override;
82   void OnRenderViewReady(CefRefPtr<CefBrowser> browser) override;
83   void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
84                                  TerminationStatus status) override;
85   void OnDocumentAvailableInMainFrame(CefRefPtr<CefBrowser> browser) override;
86 };
87 
88 #endif  // CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_
89