• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2021 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=92c4d38f6895018f72fbafeecb13c47320ef0b1d$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 #include "include/capi/cef_devtools_message_observer_capi.h"
45 #include "include/capi/cef_drag_data_capi.h"
46 #include "include/capi/cef_frame_capi.h"
47 #include "include/capi/cef_image_capi.h"
48 #include "include/capi/cef_navigation_entry_capi.h"
49 #include "include/capi/cef_registration_capi.h"
50 #include "include/capi/cef_request_context_capi.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 struct _cef_browser_host_t;
57 struct _cef_client_t;
58 
59 ///
60 // Structure used to represent a browser window. When used in the browser
61 // process the functions of this structure may be called on any thread unless
62 // otherwise indicated in the comments. When used in the render process the
63 // functions of this structure may only be called on the main thread.
64 ///
65 typedef struct _cef_browser_t {
66   ///
67   // Base structure.
68   ///
69   cef_base_ref_counted_t base;
70 
71   ///
72   // Returns the browser host object. This function can only be called in the
73   // browser process.
74   ///
75   struct _cef_browser_host_t*(CEF_CALLBACK* get_host)(
76       struct _cef_browser_t* self);
77 
78   ///
79   // Returns true (1) if the browser can navigate backwards.
80   ///
81   int(CEF_CALLBACK* can_go_back)(struct _cef_browser_t* self);
82 
83   ///
84   // Navigate backwards.
85   ///
86   void(CEF_CALLBACK* go_back)(struct _cef_browser_t* self);
87 
88   ///
89   // Returns true (1) if the browser can navigate forwards.
90   ///
91   int(CEF_CALLBACK* can_go_forward)(struct _cef_browser_t* self);
92 
93   ///
94   // Navigate forwards.
95   ///
96   void(CEF_CALLBACK* go_forward)(struct _cef_browser_t* self);
97 
98   ///
99   // Returns true (1) if the browser is currently loading.
100   ///
101   int(CEF_CALLBACK* is_loading)(struct _cef_browser_t* self);
102 
103   ///
104   // Reload the current page.
105   ///
106   void(CEF_CALLBACK* reload)(struct _cef_browser_t* self);
107 
108   ///
109   // Reload the current page ignoring any cached data.
110   ///
111   void(CEF_CALLBACK* reload_ignore_cache)(struct _cef_browser_t* self);
112 
113   ///
114   // Stop loading the page.
115   ///
116   void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self);
117 
118   ///
119   // Returns the globally unique identifier for this browser. This value is also
120   // used as the tabId for extension APIs.
121   ///
122   int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self);
123 
124   ///
125   // Returns true (1) if this object is pointing to the same handle as |that|
126   // object.
127   ///
128   int(CEF_CALLBACK* is_same)(struct _cef_browser_t* self,
129                              struct _cef_browser_t* that);
130 
131   ///
132   // Returns true (1) if the window is a popup window.
133   ///
134   int(CEF_CALLBACK* is_popup)(struct _cef_browser_t* self);
135 
136   ///
137   // Returns true (1) if a document has been loaded in the browser.
138   ///
139   int(CEF_CALLBACK* has_document)(struct _cef_browser_t* self);
140 
141   ///
142   // Returns the main (top-level) frame for the browser window. In the browser
143   // process this will return a valid object until after
144   // cef_life_span_handler_t::OnBeforeClose is called. In the renderer process
145   // this will return NULL if the main frame is hosted in a different renderer
146   // process (e.g. for cross-origin sub-frames).
147   ///
148   struct _cef_frame_t*(CEF_CALLBACK* get_main_frame)(
149       struct _cef_browser_t* self);
150 
151   ///
152   // Returns the focused frame for the browser window.
153   ///
154   struct _cef_frame_t*(CEF_CALLBACK* get_focused_frame)(
155       struct _cef_browser_t* self);
156 
157   ///
158   // Returns the frame with the specified identifier, or NULL if not found.
159   ///
160   struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
161       struct _cef_browser_t* self,
162       int64 identifier);
163 
164   ///
165   // Returns the frame with the specified name, or NULL if not found.
166   ///
167   struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
168                                                 const cef_string_t* name);
169 
170   ///
171   // Returns the number of frames that currently exist.
172   ///
173   size_t(CEF_CALLBACK* get_frame_count)(struct _cef_browser_t* self);
174 
175   ///
176   // Returns the identifiers of all existing frames.
177   ///
178   void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
179                                             size_t* identifiersCount,
180                                             int64* identifiers);
181 
182   ///
183   // Returns the names of all existing frames.
184   ///
185   void(CEF_CALLBACK* get_frame_names)(struct _cef_browser_t* self,
186                                       cef_string_list_t names);
187 } cef_browser_t;
188 
189 ///
190 // Callback structure for cef_browser_host_t::RunFileDialog. The functions of
191 // this structure will be called on the browser process UI thread.
192 ///
193 typedef struct _cef_run_file_dialog_callback_t {
194   ///
195   // Base structure.
196   ///
197   cef_base_ref_counted_t base;
198 
199   ///
200   // Called asynchronously after the file dialog is dismissed.
201   // |selected_accept_filter| is the 0-based index of the value selected from
202   // the accept filters array passed to cef_browser_host_t::RunFileDialog.
203   // |file_paths| will be a single value or a list of values depending on the
204   // dialog mode. If the selection was cancelled |file_paths| will be NULL.
205   ///
206   void(CEF_CALLBACK* on_file_dialog_dismissed)(
207       struct _cef_run_file_dialog_callback_t* self,
208       int selected_accept_filter,
209       cef_string_list_t file_paths);
210 } cef_run_file_dialog_callback_t;
211 
212 ///
213 // Callback structure for cef_browser_host_t::GetNavigationEntries. The
214 // functions of this structure will be called on the browser process UI thread.
215 ///
216 typedef struct _cef_navigation_entry_visitor_t {
217   ///
218   // Base structure.
219   ///
220   cef_base_ref_counted_t base;
221 
222   ///
223   // Method that will be executed. Do not keep a reference to |entry| outside of
224   // this callback. Return true (1) to continue visiting entries or false (0) to
225   // stop. |current| is true (1) if this entry is the currently loaded
226   // navigation entry. |index| is the 0-based index of this entry and |total| is
227   // the total number of entries.
228   ///
229   int(CEF_CALLBACK* visit)(struct _cef_navigation_entry_visitor_t* self,
230                            struct _cef_navigation_entry_t* entry,
231                            int current,
232                            int index,
233                            int total);
234 } cef_navigation_entry_visitor_t;
235 
236 ///
237 // Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
238 // structure will be called on the browser process UI thread.
239 ///
240 typedef struct _cef_pdf_print_callback_t {
241   ///
242   // Base structure.
243   ///
244   cef_base_ref_counted_t base;
245 
246   ///
247   // Method that will be executed when the PDF printing has completed. |path| is
248   // the output path. |ok| will be true (1) if the printing completed
249   // successfully or false (0) otherwise.
250   ///
251   void(CEF_CALLBACK* on_pdf_print_finished)(
252       struct _cef_pdf_print_callback_t* self,
253       const cef_string_t* path,
254       int ok);
255 } cef_pdf_print_callback_t;
256 
257 ///
258 // Callback structure for cef_browser_host_t::DownloadImage. The functions of
259 // this structure will be called on the browser process UI thread.
260 ///
261 typedef struct _cef_download_image_callback_t {
262   ///
263   // Base structure.
264   ///
265   cef_base_ref_counted_t base;
266 
267   ///
268   // Method that will be executed when the image download has completed.
269   // |image_url| is the URL that was downloaded and |http_status_code| is the
270   // resulting HTTP status code. |image| is the resulting image, possibly at
271   // multiple scale factors, or NULL if the download failed.
272   ///
273   void(CEF_CALLBACK* on_download_image_finished)(
274       struct _cef_download_image_callback_t* self,
275       const cef_string_t* image_url,
276       int http_status_code,
277       struct _cef_image_t* image);
278 } cef_download_image_callback_t;
279 
280 ///
281 // Structure used to represent the browser process aspects of a browser window.
282 // The functions of this structure can only be called in the browser process.
283 // They may be called on any thread in that process unless otherwise indicated
284 // in the comments.
285 ///
286 typedef struct _cef_browser_host_t {
287   ///
288   // Base structure.
289   ///
290   cef_base_ref_counted_t base;
291 
292   ///
293   // Returns the hosted browser object.
294   ///
295   struct _cef_browser_t*(CEF_CALLBACK* get_browser)(
296       struct _cef_browser_host_t* self);
297 
298   ///
299   // Request that the browser close. The JavaScript 'onbeforeunload' event will
300   // be fired. If |force_close| is false (0) the event handler, if any, will be
301   // allowed to prompt the user and the user can optionally cancel the close. If
302   // |force_close| is true (1) the prompt will not be displayed and the close
303   // will proceed. Results in a call to cef_life_span_handler_t::do_close() if
304   // the event handler allows the close or if |force_close| is true (1). See
305   // cef_life_span_handler_t::do_close() documentation for additional usage
306   // information.
307   ///
308   void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self,
309                                     int force_close);
310 
311   ///
312   // Helper for closing a browser. Call this function from the top-level window
313   // close handler. Internally this calls CloseBrowser(false (0)) if the close
314   // has not yet been initiated. This function returns false (0) while the close
315   // is pending and true (1) after the close has completed. See close_browser()
316   // and cef_life_span_handler_t::do_close() documentation for additional usage
317   // information. This function must be called on the browser process UI thread.
318   ///
319   int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self);
320 
321   ///
322   // Set whether the browser is focused.
323   ///
324   void(CEF_CALLBACK* set_focus)(struct _cef_browser_host_t* self, int focus);
325 
326   ///
327   // Retrieve the window handle for this browser. If this browser is wrapped in
328   // a cef_browser_view_t this function should be called on the browser process
329   // UI thread and it will return the handle for the top-level native window.
330   ///
331   cef_window_handle_t(CEF_CALLBACK* get_window_handle)(
332       struct _cef_browser_host_t* self);
333 
334   ///
335   // Retrieve the window handle of the browser that opened this browser. Will
336   // return NULL for non-popup windows or if this browser is wrapped in a
337   // cef_browser_view_t. This function can be used in combination with custom
338   // handling of modal windows.
339   ///
340   cef_window_handle_t(CEF_CALLBACK* get_opener_window_handle)(
341       struct _cef_browser_host_t* self);
342 
343   ///
344   // Returns true (1) if this browser is wrapped in a cef_browser_view_t.
345   ///
346   int(CEF_CALLBACK* has_view)(struct _cef_browser_host_t* self);
347 
348   ///
349   // Returns the client for this browser.
350   ///
351   struct _cef_client_t*(CEF_CALLBACK* get_client)(
352       struct _cef_browser_host_t* self);
353 
354   ///
355   // Returns the request context for this browser.
356   ///
357   struct _cef_request_context_t*(CEF_CALLBACK* get_request_context)(
358       struct _cef_browser_host_t* self);
359 
360   ///
361   // Get the current zoom level. The default zoom level is 0.0. This function
362   // can only be called on the UI thread.
363   ///
364   double(CEF_CALLBACK* get_zoom_level)(struct _cef_browser_host_t* self);
365 
366   ///
367   // Change the zoom level to the specified value. Specify 0.0 to reset the zoom
368   // level. If called on the UI thread the change will be applied immediately.
369   // Otherwise, the change will be applied asynchronously on the UI thread.
370   ///
371   void(CEF_CALLBACK* set_zoom_level)(struct _cef_browser_host_t* self,
372                                      double zoomLevel);
373 
374   ///
375   // Call to run a file chooser dialog. Only a single file chooser dialog may be
376   // pending at any given time. |mode| represents the type of dialog to display.
377   // |title| to the title to be used for the dialog and may be NULL to show the
378   // default title ("Open" or "Save" depending on the mode). |default_file_path|
379   // is the path with optional directory and/or file name component that will be
380   // initially selected in the dialog. |accept_filters| are used to restrict the
381   // selectable file types and may any combination of (a) valid lower-cased MIME
382   // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g.
383   // ".txt" or ".png"), or (c) combined description and file extension delimited
384   // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
385   // |selected_accept_filter| is the 0-based index of the filter that will be
386   // selected by default. |callback| will be executed after the dialog is
387   // dismissed or immediately if another dialog is already pending. The dialog
388   // will be initiated asynchronously on the UI thread.
389   ///
390   void(CEF_CALLBACK* run_file_dialog)(
391       struct _cef_browser_host_t* self,
392       cef_file_dialog_mode_t mode,
393       const cef_string_t* title,
394       const cef_string_t* default_file_path,
395       cef_string_list_t accept_filters,
396       int selected_accept_filter,
397       struct _cef_run_file_dialog_callback_t* callback);
398 
399   ///
400   // Download the file at |url| using cef_download_handler_t.
401   ///
402   void(CEF_CALLBACK* start_download)(struct _cef_browser_host_t* self,
403                                      const cef_string_t* url);
404 
405   ///
406   // Download |image_url| and execute |callback| on completion with the images
407   // received from the renderer. If |is_favicon| is true (1) then cookies are
408   // not sent and not accepted during download. Images with density independent
409   // pixel (DIP) sizes larger than |max_image_size| are filtered out from the
410   // image results. Versions of the image at different scale factors may be
411   // downloaded up to the maximum scale factor supported by the system. If there
412   // are no image results <= |max_image_size| then the smallest image is resized
413   // to |max_image_size| and is the only result. A |max_image_size| of 0 means
414   // unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
415   // the server even if it is present in the browser cache.
416   ///
417   void(CEF_CALLBACK* download_image)(
418       struct _cef_browser_host_t* self,
419       const cef_string_t* image_url,
420       int is_favicon,
421       uint32 max_image_size,
422       int bypass_cache,
423       struct _cef_download_image_callback_t* callback);
424 
425   ///
426   // Print the current browser contents.
427   ///
428   void(CEF_CALLBACK* print)(struct _cef_browser_host_t* self);
429 
430   ///
431   // Print the current browser contents to the PDF file specified by |path| and
432   // execute |callback| on completion. The caller is responsible for deleting
433   // |path| when done. For PDF printing to work on Linux you must implement the
434   // cef_print_handler_t::GetPdfPaperSize function.
435   ///
436   void(CEF_CALLBACK* print_to_pdf)(
437       struct _cef_browser_host_t* self,
438       const cef_string_t* path,
439       const struct _cef_pdf_print_settings_t* settings,
440       struct _cef_pdf_print_callback_t* callback);
441 
442   ///
443   // Search for |searchText|. |identifier| must be a unique ID and these IDs
444   // must strictly increase so that newer requests always have greater IDs than
445   // older requests. If |identifier| is zero or less than the previous ID value
446   // then it will be automatically assigned a new valid ID. |forward| indicates
447   // whether to search forward or backward within the page. |matchCase|
448   // indicates whether the search should be case-sensitive. |findNext| indicates
449   // whether this is the first request or a follow-up. The cef_find_handler_t
450   // instance, if any, returned via cef_client_t::GetFindHandler will be called
451   // to report find results.
452   ///
453   void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
454                            int identifier,
455                            const cef_string_t* searchText,
456                            int forward,
457                            int matchCase,
458                            int findNext);
459 
460   ///
461   // Cancel all searches that are currently going on.
462   ///
463   void(CEF_CALLBACK* stop_finding)(struct _cef_browser_host_t* self,
464                                    int clearSelection);
465 
466   ///
467   // Open developer tools (DevTools) in its own browser. The DevTools browser
468   // will remain associated with this browser. If the DevTools browser is
469   // already open then it will be focused, in which case the |windowInfo|,
470   // |client| and |settings| parameters will be ignored. If |inspect_element_at|
471   // is non-NULL then the element at the specified (x,y) location will be
472   // inspected. The |windowInfo| parameter will be ignored if this browser is
473   // wrapped in a cef_browser_view_t.
474   ///
475   void(CEF_CALLBACK* show_dev_tools)(
476       struct _cef_browser_host_t* self,
477       const struct _cef_window_info_t* windowInfo,
478       struct _cef_client_t* client,
479       const struct _cef_browser_settings_t* settings,
480       const cef_point_t* inspect_element_at);
481 
482   ///
483   // Explicitly close the associated DevTools browser, if any.
484   ///
485   void(CEF_CALLBACK* close_dev_tools)(struct _cef_browser_host_t* self);
486 
487   ///
488   // Returns true (1) if this browser currently has an associated DevTools
489   // browser. Must be called on the browser process UI thread.
490   ///
491   int(CEF_CALLBACK* has_dev_tools)(struct _cef_browser_host_t* self);
492 
493   ///
494   // Send a function call message over the DevTools protocol. |message| must be
495   // a UTF8-encoded JSON dictionary that contains "id" (int), "function"
496   // (string) and "params" (dictionary, optional) values. See the DevTools
497   // protocol documentation at https://chromedevtools.github.io/devtools-
498   // protocol/ for details of supported functions and the expected "params"
499   // dictionary contents. |message| will be copied if necessary. This function
500   // will return true (1) if called on the UI thread and the message was
501   // successfully submitted for validation, otherwise false (0). Validation will
502   // be applied asynchronously and any messages that fail due to formatting
503   // errors or missing parameters may be discarded without notification. Prefer
504   // ExecuteDevToolsMethod if a more structured approach to message formatting
505   // is desired.
506   //
507   // Every valid function call will result in an asynchronous function result or
508   // error message that references the sent message "id". Event messages are
509   // received while notifications are enabled (for example, between function
510   // calls for "Page.enable" and "Page.disable"). All received messages will be
511   // delivered to the observer(s) registered with AddDevToolsMessageObserver.
512   // See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for
513   // details of received message contents.
514   //
515   // Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and
516   // AddDevToolsMessageObserver functions does not require an active DevTools
517   // front-end or remote-debugging session. Other active DevTools sessions will
518   // continue to function independently. However, any modification of global
519   // browser state by one session may not be reflected in the UI of other
520   // sessions.
521   //
522   // Communication with the DevTools front-end (when displayed) can be logged
523   // for development purposes by passing the `--devtools-protocol-log-
524   // file=<path>` command-line flag.
525   ///
526   int(CEF_CALLBACK* send_dev_tools_message)(struct _cef_browser_host_t* self,
527                                             const void* message,
528                                             size_t message_size);
529 
530   ///
531   // Execute a function call over the DevTools protocol. This is a more
532   // structured version of SendDevToolsMessage. |message_id| is an incremental
533   // number that uniquely identifies the message (pass 0 to have the next number
534   // assigned automatically based on previous values). |function| is the
535   // function name. |params| are the function parameters, which may be NULL. See
536   // the DevTools protocol documentation (linked above) for details of supported
537   // functions and the expected |params| dictionary contents. This function will
538   // return the assigned message ID if called on the UI thread and the message
539   // was successfully submitted for validation, otherwise 0. See the
540   // SendDevToolsMessage documentation for additional usage information.
541   ///
542   int(CEF_CALLBACK* execute_dev_tools_method)(
543       struct _cef_browser_host_t* self,
544       int message_id,
545       const cef_string_t* method,
546       struct _cef_dictionary_value_t* params);
547 
548   ///
549   // Add an observer for DevTools protocol messages (function results and
550   // events). The observer will remain registered until the returned
551   // Registration object is destroyed. See the SendDevToolsMessage documentation
552   // for additional usage information.
553   ///
554   struct _cef_registration_t*(CEF_CALLBACK* add_dev_tools_message_observer)(
555       struct _cef_browser_host_t* self,
556       struct _cef_dev_tools_message_observer_t* observer);
557 
558   ///
559   // Retrieve a snapshot of current navigation entries as values sent to the
560   // specified visitor. If |current_only| is true (1) only the current
561   // navigation entry will be sent, otherwise all navigation entries will be
562   // sent.
563   ///
564   void(CEF_CALLBACK* get_navigation_entries)(
565       struct _cef_browser_host_t* self,
566       struct _cef_navigation_entry_visitor_t* visitor,
567       int current_only);
568 
569   ///
570   // If a misspelled word is currently selected in an editable node calling this
571   // function will replace it with the specified |word|.
572   ///
573   void(CEF_CALLBACK* replace_misspelling)(struct _cef_browser_host_t* self,
574                                           const cef_string_t* word);
575 
576   ///
577   // Add the specified |word| to the spelling dictionary.
578   ///
579   void(CEF_CALLBACK* add_word_to_dictionary)(struct _cef_browser_host_t* self,
580                                              const cef_string_t* word);
581 
582   ///
583   // Returns true (1) if window rendering is disabled.
584   ///
585   int(CEF_CALLBACK* is_window_rendering_disabled)(
586       struct _cef_browser_host_t* self);
587 
588   ///
589   // Notify the browser that the widget has been resized. The browser will first
590   // call cef_render_handler_t::GetViewRect to get the new size and then call
591   // cef_render_handler_t::OnPaint asynchronously with the updated regions. This
592   // function is only used when window rendering is disabled.
593   ///
594   void(CEF_CALLBACK* was_resized)(struct _cef_browser_host_t* self);
595 
596   ///
597   // Notify the browser that it has been hidden or shown. Layouting and
598   // cef_render_handler_t::OnPaint notification will stop when the browser is
599   // hidden. This function is only used when window rendering is disabled.
600   ///
601   void(CEF_CALLBACK* was_hidden)(struct _cef_browser_host_t* self, int hidden);
602 
603   ///
604   // Send a notification to the browser that the screen info has changed. The
605   // browser will then call cef_render_handler_t::GetScreenInfo to update the
606   // screen information with the new values. This simulates moving the webview
607   // window from one display to another, or changing the properties of the
608   // current display. This function is only used when window rendering is
609   // disabled.
610   ///
611   void(CEF_CALLBACK* notify_screen_info_changed)(
612       struct _cef_browser_host_t* self);
613 
614   ///
615   // Invalidate the view. The browser will call cef_render_handler_t::OnPaint
616   // asynchronously. This function is only used when window rendering is
617   // disabled.
618   ///
619   void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self,
620                                  cef_paint_element_type_t type);
621 
622   ///
623   // Issue a BeginFrame request to Chromium.  Only valid when
624   // cef_window_tInfo::external_begin_frame_enabled is set to true (1).
625   ///
626   void(CEF_CALLBACK* send_external_begin_frame)(
627       struct _cef_browser_host_t* self);
628 
629   ///
630   // Send a key event to the browser.
631   ///
632   void(CEF_CALLBACK* send_key_event)(struct _cef_browser_host_t* self,
633                                      const struct _cef_key_event_t* event);
634 
635   ///
636   // Send a mouse click event to the browser. The |x| and |y| coordinates are
637   // relative to the upper-left corner of the view.
638   ///
639   void(CEF_CALLBACK* send_mouse_click_event)(
640       struct _cef_browser_host_t* self,
641       const struct _cef_mouse_event_t* event,
642       cef_mouse_button_type_t type,
643       int mouseUp,
644       int clickCount);
645 
646   ///
647   // Send a mouse move event to the browser. The |x| and |y| coordinates are
648   // relative to the upper-left corner of the view.
649   ///
650   void(CEF_CALLBACK* send_mouse_move_event)(
651       struct _cef_browser_host_t* self,
652       const struct _cef_mouse_event_t* event,
653       int mouseLeave);
654 
655   ///
656   // Send a mouse wheel event to the browser. The |x| and |y| coordinates are
657   // relative to the upper-left corner of the view. The |deltaX| and |deltaY|
658   // values represent the movement delta in the X and Y directions respectively.
659   // In order to scroll inside select popups with window rendering disabled
660   // cef_render_handler_t::GetScreenPoint should be implemented properly.
661   ///
662   void(CEF_CALLBACK* send_mouse_wheel_event)(
663       struct _cef_browser_host_t* self,
664       const struct _cef_mouse_event_t* event,
665       int deltaX,
666       int deltaY);
667 
668   ///
669   // Send a touch event to the browser for a windowless browser.
670   ///
671   void(CEF_CALLBACK* send_touch_event)(struct _cef_browser_host_t* self,
672                                        const struct _cef_touch_event_t* event);
673 
674   ///
675   // Send a focus event to the browser.
676   ///
677   void(CEF_CALLBACK* send_focus_event)(struct _cef_browser_host_t* self,
678                                        int setFocus);
679 
680   ///
681   // Send a capture lost event to the browser.
682   ///
683   void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self);
684 
685   ///
686   // Notify the browser that the window hosting it is about to be moved or
687   // resized. This function is only used on Windows and Linux.
688   ///
689   void(CEF_CALLBACK* notify_move_or_resize_started)(
690       struct _cef_browser_host_t* self);
691 
692   ///
693   // Returns the maximum rate in frames per second (fps) that
694   // cef_render_handler_t:: OnPaint will be called for a windowless browser. The
695   // actual fps may be lower if the browser cannot generate frames at the
696   // requested rate. The minimum value is 1 and the maximum value is 60 (default
697   // 30). This function can only be called on the UI thread.
698   ///
699   int(CEF_CALLBACK* get_windowless_frame_rate)(
700       struct _cef_browser_host_t* self);
701 
702   ///
703   // Set the maximum rate in frames per second (fps) that cef_render_handler_t::
704   // OnPaint will be called for a windowless browser. The actual fps may be
705   // lower if the browser cannot generate frames at the requested rate. The
706   // minimum value is 1 and the maximum value is 60 (default 30). Can also be
707   // set at browser creation via cef_browser_tSettings.windowless_frame_rate.
708   ///
709   void(CEF_CALLBACK* set_windowless_frame_rate)(
710       struct _cef_browser_host_t* self,
711       int frame_rate);
712 
713   ///
714   // Begins a new composition or updates the existing composition. Blink has a
715   // special node (a composition node) that allows the input function to change
716   // text without affecting other DOM nodes. |text| is the optional text that
717   // will be inserted into the composition node. |underlines| is an optional set
718   // of ranges that will be underlined in the resulting text.
719   // |replacement_range| is an optional range of the existing text that will be
720   // replaced. |selection_range| is an optional range of the resulting text that
721   // will be selected after insertion or replacement. The |replacement_range|
722   // value is only used on OS X.
723   //
724   // This function may be called multiple times as the composition changes. When
725   // the client is done making changes the composition should either be canceled
726   // or completed. To cancel the composition call ImeCancelComposition. To
727   // complete the composition call either ImeCommitText or
728   // ImeFinishComposingText. Completion is usually signaled when:
729   //   A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
730   //      flag (on Windows), or;
731   //   B. The client receives a "commit" signal of GtkIMContext (on Linux), or;
732   //   C. insertText of NSTextInput is called (on Mac).
733   //
734   // This function is only used when window rendering is disabled.
735   ///
736   void(CEF_CALLBACK* ime_set_composition)(
737       struct _cef_browser_host_t* self,
738       const cef_string_t* text,
739       size_t underlinesCount,
740       cef_composition_underline_t const* underlines,
741       const cef_range_t* replacement_range,
742       const cef_range_t* selection_range);
743 
744   ///
745   // Completes the existing composition by optionally inserting the specified
746   // |text| into the composition node. |replacement_range| is an optional range
747   // of the existing text that will be replaced. |relative_cursor_pos| is where
748   // the cursor will be positioned relative to the current cursor position. See
749   // comments on ImeSetComposition for usage. The |replacement_range| and
750   // |relative_cursor_pos| values are only used on OS X. This function is only
751   // used when window rendering is disabled.
752   ///
753   void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self,
754                                       const cef_string_t* text,
755                                       const cef_range_t* replacement_range,
756                                       int relative_cursor_pos);
757 
758   ///
759   // Completes the existing composition by applying the current composition node
760   // contents. If |keep_selection| is false (0) the current selection, if any,
761   // will be discarded. See comments on ImeSetComposition for usage. This
762   // function is only used when window rendering is disabled.
763   ///
764   void(CEF_CALLBACK* ime_finish_composing_text)(
765       struct _cef_browser_host_t* self,
766       int keep_selection);
767 
768   ///
769   // Cancels the existing composition and discards the composition node contents
770   // without applying them. See comments on ImeSetComposition for usage. This
771   // function is only used when window rendering is disabled.
772   ///
773   void(CEF_CALLBACK* ime_cancel_composition)(struct _cef_browser_host_t* self);
774 
775   ///
776   // Call this function when the user drags the mouse into the web view (before
777   // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
778   // should not contain file contents as this type of data is not allowed to be
779   // dragged into the web view. File contents can be removed using
780   // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
781   // cef_render_handler_t::StartDragging). This function is only used when
782   // window rendering is disabled.
783   ///
784   void(CEF_CALLBACK* drag_target_drag_enter)(
785       struct _cef_browser_host_t* self,
786       struct _cef_drag_data_t* drag_data,
787       const struct _cef_mouse_event_t* event,
788       cef_drag_operations_mask_t allowed_ops);
789 
790   ///
791   // Call this function each time the mouse is moved across the web view during
792   // a drag operation (after calling DragTargetDragEnter and before calling
793   // DragTargetDragLeave/DragTargetDrop). This function is only used when window
794   // rendering is disabled.
795   ///
796   void(CEF_CALLBACK* drag_target_drag_over)(
797       struct _cef_browser_host_t* self,
798       const struct _cef_mouse_event_t* event,
799       cef_drag_operations_mask_t allowed_ops);
800 
801   ///
802   // Call this function when the user drags the mouse out of the web view (after
803   // calling DragTargetDragEnter). This function is only used when window
804   // rendering is disabled.
805   ///
806   void(CEF_CALLBACK* drag_target_drag_leave)(struct _cef_browser_host_t* self);
807 
808   ///
809   // Call this function when the user completes the drag operation by dropping
810   // the object onto the web view (after calling DragTargetDragEnter). The
811   // object being dropped is |drag_data|, given as an argument to the previous
812   // DragTargetDragEnter call. This function is only used when window rendering
813   // is disabled.
814   ///
815   void(CEF_CALLBACK* drag_target_drop)(struct _cef_browser_host_t* self,
816                                        const struct _cef_mouse_event_t* event);
817 
818   ///
819   // Call this function when the drag operation started by a
820   // cef_render_handler_t::StartDragging call has ended either in a drop or by
821   // being cancelled. |x| and |y| are mouse coordinates relative to the upper-
822   // left corner of the view. If the web view is both the drag source and the
823   // drag target then all DragTarget* functions should be called before
824   // DragSource* mthods. This function is only used when window rendering is
825   // disabled.
826   ///
827   void(CEF_CALLBACK* drag_source_ended_at)(struct _cef_browser_host_t* self,
828                                            int x,
829                                            int y,
830                                            cef_drag_operations_mask_t op);
831 
832   ///
833   // Call this function when the drag operation started by a
834   // cef_render_handler_t::StartDragging call has completed. This function may
835   // be called immediately without first calling DragSourceEndedAt to cancel a
836   // drag operation. If the web view is both the drag source and the drag target
837   // then all DragTarget* functions should be called before DragSource* mthods.
838   // This function is only used when window rendering is disabled.
839   ///
840   void(CEF_CALLBACK* drag_source_system_drag_ended)(
841       struct _cef_browser_host_t* self);
842 
843   ///
844   // Returns the current visible navigation entry for this browser. This
845   // function can only be called on the UI thread.
846   ///
847   struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)(
848       struct _cef_browser_host_t* self);
849 
850   ///
851   // Set accessibility state for all frames. |accessibility_state| may be
852   // default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
853   // then accessibility will be disabled by default and the state may be further
854   // controlled with the "force-renderer-accessibility" and "disable-renderer-
855   // accessibility" command-line switches. If |accessibility_state| is
856   // STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
857   // is STATE_DISABLED then accessibility will be completely disabled.
858   //
859   // For windowed browsers accessibility will be enabled in Complete mode (which
860   // corresponds to kAccessibilityModeComplete in Chromium). In this mode all
861   // platform accessibility objects will be created and managed by Chromium's
862   // internal implementation. The client needs only to detect the screen reader
863   // and call this function appropriately. For example, on macOS the client can
864   // handle the @"AXEnhancedUserStructure" accessibility attribute to detect
865   // VoiceOver state changes and on Windows the client can handle WM_GETOBJECT
866   // with OBJID_CLIENT to detect accessibility readers.
867   //
868   // For windowless browsers accessibility will be enabled in TreeOnly mode
869   // (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
870   // this mode renderer accessibility is enabled, the full tree is computed, and
871   // events are passed to CefAccessibiltyHandler, but platform accessibility
872   // objects are not created. The client may implement platform accessibility
873   // objects using CefAccessibiltyHandler callbacks if desired.
874   ///
875   void(CEF_CALLBACK* set_accessibility_state)(struct _cef_browser_host_t* self,
876                                               cef_state_t accessibility_state);
877 
878   ///
879   // Enable notifications of auto resize via
880   // cef_display_handler_t::OnAutoResize. Notifications are disabled by default.
881   // |min_size| and |max_size| define the range of allowed sizes.
882   ///
883   void(CEF_CALLBACK* set_auto_resize_enabled)(struct _cef_browser_host_t* self,
884                                               int enabled,
885                                               const cef_size_t* min_size,
886                                               const cef_size_t* max_size);
887 
888   ///
889   // Returns the extension hosted in this browser or NULL if no extension is
890   // hosted. See cef_request_context_t::LoadExtension for details.
891   ///
892   struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
893       struct _cef_browser_host_t* self);
894 
895   ///
896   // Returns true (1) if this browser is hosting an extension background script.
897   // Background hosts do not have a window and are not displayable. See
898   // cef_request_context_t::LoadExtension for details.
899   ///
900   int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);
901 
902   ///
903   //  Set whether the browser's audio is muted.
904   ///
905   void(CEF_CALLBACK* set_audio_muted)(struct _cef_browser_host_t* self,
906                                       int mute);
907 
908   ///
909   // Returns true (1) if the browser's audio is muted.  This function can only
910   // be called on the UI thread.
911   ///
912   int(CEF_CALLBACK* is_audio_muted)(struct _cef_browser_host_t* self);
913 } cef_browser_host_t;
914 
915 ///
916 // Create a new browser window using the window parameters specified by
917 // |windowInfo|. All values will be copied internally and the actual window will
918 // be created on the UI thread. If |request_context| is NULL the global request
919 // context will be used. This function can be called on any browser process
920 // thread and will not block. The optional |extra_info| parameter provides an
921 // opportunity to specify extra information specific to the created browser that
922 // will be passed to cef_render_process_handler_t::on_browser_created() in the
923 // render process.
924 ///
925 CEF_EXPORT int cef_browser_host_create_browser(
926     const cef_window_info_t* windowInfo,
927     struct _cef_client_t* client,
928     const cef_string_t* url,
929     const struct _cef_browser_settings_t* settings,
930     struct _cef_dictionary_value_t* extra_info,
931     struct _cef_request_context_t* request_context);
932 
933 ///
934 // Create a new browser window using the window parameters specified by
935 // |windowInfo|. If |request_context| is NULL the global request context will be
936 // used. This function can only be called on the browser process UI thread. The
937 // optional |extra_info| parameter provides an opportunity to specify extra
938 // information specific to the created browser that will be passed to
939 // cef_render_process_handler_t::on_browser_created() in the render process.
940 ///
941 CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
942     const cef_window_info_t* windowInfo,
943     struct _cef_client_t* client,
944     const cef_string_t* url,
945     const struct _cef_browser_settings_t* settings,
946     struct _cef_dictionary_value_t* extra_info,
947     struct _cef_request_context_t* request_context);
948 
949 #ifdef __cplusplus
950 }
951 #endif
952 
953 #endif  // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
954