• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36 // $hash=b44d320d5cceb5022543e8154170b8d276628c76$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 #include "include/capi/cef_browser_capi.h"
45 #include "include/capi/cef_frame_capi.h"
46 #include "include/capi/cef_request_capi.h"
47 #include "include/capi/cef_resource_request_handler_capi.h"
48 #include "include/capi/cef_web_plugin_capi.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 ///
55 // Implement this structure to provide handler implementations. The handler
56 // instance will not be released until all objects related to the context have
57 // been destroyed.
58 ///
59 typedef struct _cef_request_context_handler_t {
60   ///
61   // Base structure.
62   ///
63   cef_base_ref_counted_t base;
64 
65   ///
66   // Called on the browser process UI thread immediately after the request
67   // context has been initialized.
68   ///
69   void(CEF_CALLBACK* on_request_context_initialized)(
70       struct _cef_request_context_handler_t* self,
71       struct _cef_request_context_t* request_context);
72 
73   ///
74   // Called on the browser process IO thread before a resource request is
75   // initiated. The |browser| and |frame| values represent the source of the
76   // request, and may be NULL for requests originating from service workers or
77   // cef_urlrequest_t. |request| represents the request contents and cannot be
78   // modified in this callback. |is_navigation| will be true (1) if the resource
79   // request is a navigation. |is_download| will be true (1) if the resource
80   // request is a download. |request_initiator| is the origin (scheme + domain)
81   // of the page that initiated the request. Set |disable_default_handling| to
82   // true (1) to disable default handling of the request, in which case it will
83   // need to be handled via cef_resource_request_handler_t::GetResourceHandler
84   // or it will be canceled. To allow the resource load to proceed with default
85   // handling return NULL. To specify a handler for the resource return a
86   // cef_resource_request_handler_t object. This function will not be called if
87   // the client associated with |browser| returns a non-NULL value from
88   // cef_request_handler_t::GetResourceRequestHandler for the same request
89   // (identified by cef_request_t::GetIdentifier).
90   ///
91   struct _cef_resource_request_handler_t*(
92       CEF_CALLBACK* get_resource_request_handler)(
93       struct _cef_request_context_handler_t* self,
94       struct _cef_browser_t* browser,
95       struct _cef_frame_t* frame,
96       struct _cef_request_t* request,
97       int is_navigation,
98       int is_download,
99       const cef_string_t* request_initiator,
100       int* disable_default_handling);
101 } cef_request_context_handler_t;
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif  // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
108