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=0b8abb0e55cb56fcb778ced72a61a108c2b28011$ 37 // 38 39 #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ 40 #define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_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_dom_capi.h" 46 #include "include/capi/cef_frame_capi.h" 47 #include "include/capi/cef_load_handler_capi.h" 48 #include "include/capi/cef_process_message_capi.h" 49 #include "include/capi/cef_v8_capi.h" 50 #include "include/capi/cef_values_capi.h" 51 52 #ifdef __cplusplus 53 extern "C" { 54 #endif 55 56 /// 57 // Structure used to implement render process callbacks. The functions of this 58 // structure will be called on the render process main thread (TID_RENDERER) 59 // unless otherwise indicated. 60 /// 61 typedef struct _cef_render_process_handler_t { 62 /// 63 // Base structure. 64 /// 65 cef_base_ref_counted_t base; 66 67 /// 68 // Called after WebKit has been initialized. 69 /// 70 void(CEF_CALLBACK* on_web_kit_initialized)( 71 struct _cef_render_process_handler_t* self); 72 73 /// 74 // Called after a browser has been created. When browsing cross-origin a new 75 // browser will be created before the old browser with the same identifier is 76 // destroyed. |extra_info| is an optional read-only value originating from 77 // cef_browser_host_t::cef_browser_host_create_browser(), 78 // cef_browser_host_t::cef_browser_host_create_browser_sync(), 79 // cef_life_span_handler_t::on_before_popup() or 80 // cef_browser_view_t::cef_browser_view_create(). 81 /// 82 void(CEF_CALLBACK* on_browser_created)( 83 struct _cef_render_process_handler_t* self, 84 struct _cef_browser_t* browser, 85 struct _cef_dictionary_value_t* extra_info); 86 87 /// 88 // Called before a browser is destroyed. 89 /// 90 void(CEF_CALLBACK* on_browser_destroyed)( 91 struct _cef_render_process_handler_t* self, 92 struct _cef_browser_t* browser); 93 94 /// 95 // Return the handler for browser load status events. 96 /// 97 struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)( 98 struct _cef_render_process_handler_t* self); 99 100 /// 101 // Called immediately after the V8 context for a frame has been created. To 102 // retrieve the JavaScript 'window' object use the 103 // cef_v8context_t::get_global() function. V8 handles can only be accessed 104 // from the thread on which they are created. A task runner for posting tasks 105 // on the associated thread can be retrieved via the 106 // cef_v8context_t::get_task_runner() function. 107 /// 108 void(CEF_CALLBACK* on_context_created)( 109 struct _cef_render_process_handler_t* self, 110 struct _cef_browser_t* browser, 111 struct _cef_frame_t* frame, 112 struct _cef_v8context_t* context); 113 114 /// 115 // Called immediately before the V8 context for a frame is released. No 116 // references to the context should be kept after this function is called. 117 /// 118 void(CEF_CALLBACK* on_context_released)( 119 struct _cef_render_process_handler_t* self, 120 struct _cef_browser_t* browser, 121 struct _cef_frame_t* frame, 122 struct _cef_v8context_t* context); 123 124 /// 125 // Called for global uncaught exceptions in a frame. Execution of this 126 // callback is disabled by default. To enable set 127 // CefSettings.uncaught_exception_stack_size > 0. 128 /// 129 void(CEF_CALLBACK* on_uncaught_exception)( 130 struct _cef_render_process_handler_t* self, 131 struct _cef_browser_t* browser, 132 struct _cef_frame_t* frame, 133 struct _cef_v8context_t* context, 134 struct _cef_v8exception_t* exception, 135 struct _cef_v8stack_trace_t* stackTrace); 136 137 /// 138 // Called when a new node in the the browser gets focus. The |node| value may 139 // be NULL if no specific node has gained focus. The node object passed to 140 // this function represents a snapshot of the DOM at the time this function is 141 // executed. DOM objects are only valid for the scope of this function. Do not 142 // keep references to or attempt to access any DOM objects outside the scope 143 // of this function. 144 /// 145 void(CEF_CALLBACK* on_focused_node_changed)( 146 struct _cef_render_process_handler_t* self, 147 struct _cef_browser_t* browser, 148 struct _cef_frame_t* frame, 149 struct _cef_domnode_t* node); 150 151 /// 152 // Called when a new message is received from a different process. Return true 153 // (1) if the message was handled or false (0) otherwise. It is safe to keep a 154 // reference to |message| outside of this callback. 155 /// 156 int(CEF_CALLBACK* on_process_message_received)( 157 struct _cef_render_process_handler_t* self, 158 struct _cef_browser_t* browser, 159 struct _cef_frame_t* frame, 160 cef_process_id_t source_process, 161 struct _cef_process_message_t* message); 162 } cef_render_process_handler_t; 163 164 #ifdef __cplusplus 165 } 166 #endif 167 168 #endif // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ 169