• 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=520df1f3e00efbffc9d499149f2f797bf0f85c99$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
40 #define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_client_capi.h"
44 #include "include/capi/views/cef_view_delegate_capi.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 struct _cef_browser_t;
51 struct _cef_browser_view_t;
52 
53 ///
54 // Implement this structure to handle BrowserView events. The functions of this
55 // structure will be called on the browser process UI thread unless otherwise
56 // indicated.
57 ///
58 typedef struct _cef_browser_view_delegate_t {
59   ///
60   // Base structure.
61   ///
62   cef_view_delegate_t base;
63 
64   ///
65   // Called when |browser| associated with |browser_view| is created. This
66   // function will be called after cef_life_span_handler_t::on_after_created()
67   // is called for |browser| and before on_popup_browser_view_created() is
68   // called for |browser|'s parent delegate if |browser| is a popup.
69   ///
70   void(CEF_CALLBACK* on_browser_created)(
71       struct _cef_browser_view_delegate_t* self,
72       struct _cef_browser_view_t* browser_view,
73       struct _cef_browser_t* browser);
74 
75   ///
76   // Called when |browser| associated with |browser_view| is destroyed. Release
77   // all references to |browser| and do not attempt to execute any functions on
78   // |browser| after this callback returns. This function will be called before
79   // cef_life_span_handler_t::on_before_close() is called for |browser|.
80   ///
81   void(CEF_CALLBACK* on_browser_destroyed)(
82       struct _cef_browser_view_delegate_t* self,
83       struct _cef_browser_view_t* browser_view,
84       struct _cef_browser_t* browser);
85 
86   ///
87   // Called before a new popup BrowserView is created. The popup originated from
88   // |browser_view|. |settings| and |client| are the values returned from
89   // cef_life_span_handler_t::on_before_popup(). |is_devtools| will be true (1)
90   // if the popup will be a DevTools browser. Return the delegate that will be
91   // used for the new popup BrowserView.
92   ///
93   struct _cef_browser_view_delegate_t*(
94       CEF_CALLBACK* get_delegate_for_popup_browser_view)(
95       struct _cef_browser_view_delegate_t* self,
96       struct _cef_browser_view_t* browser_view,
97       const struct _cef_browser_settings_t* settings,
98       struct _cef_client_t* client,
99       int is_devtools);
100 
101   ///
102   // Called after |popup_browser_view| is created. This function will be called
103   // after cef_life_span_handler_t::on_after_created() and on_browser_created()
104   // are called for the new popup browser. The popup originated from
105   // |browser_view|. |is_devtools| will be true (1) if the popup is a DevTools
106   // browser. Optionally add |popup_browser_view| to the views hierarchy
107   // yourself and return true (1). Otherwise return false (0) and a default
108   // cef_window_t will be created for the popup.
109   ///
110   int(CEF_CALLBACK* on_popup_browser_view_created)(
111       struct _cef_browser_view_delegate_t* self,
112       struct _cef_browser_view_t* browser_view,
113       struct _cef_browser_view_t* popup_browser_view,
114       int is_devtools);
115 
116   ///
117   // Returns the Chrome toolbar type that will be available via
118   // cef_browser_view_t::get_chrome_toolbar(). See that function for related
119   // documentation.
120   ///
121   cef_chrome_toolbar_type_t(CEF_CALLBACK* get_chrome_toolbar_type)(
122       struct _cef_browser_view_delegate_t* self);
123 } cef_browser_view_delegate_t;
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif  // CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
130