]> git.sesse.net Git - casparcg/blob - dependencies64/cef/linux/include/cef_browser.h
3b4ed1617e8425f06da32c967e988f9a6f1e7972
[casparcg] / dependencies64 / cef / linux / include / cef_browser.h
1 // Copyright (c) 2012 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 // The contents of this file must follow a specific format in order to
33 // support the CEF translator tool. See the translator.README.txt file in the
34 // tools directory for more information.
35 //
36
37 #ifndef CEF_INCLUDE_CEF_BROWSER_H_
38 #define CEF_INCLUDE_CEF_BROWSER_H_
39 #pragma once
40
41 #include "include/cef_base.h"
42 #include "include/cef_drag_data.h"
43 #include "include/cef_frame.h"
44 #include "include/cef_image.h"
45 #include "include/cef_navigation_entry.h"
46 #include "include/cef_process_message.h"
47 #include "include/cef_request_context.h"
48 #include <vector>
49
50 class CefBrowserHost;
51 class CefClient;
52
53
54 ///
55 // Class used to represent a browser window. When used in the browser process
56 // the methods of this class may be called on any thread unless otherwise
57 // indicated in the comments. When used in the render process the methods of
58 // this class may only be called on the main thread.
59 ///
60 /*--cef(source=library)--*/
61 class CefBrowser : public virtual CefBaseRefCounted {
62  public:
63   ///
64   // Returns the browser host object. This method can only be called in the
65   // browser process.
66   ///
67   /*--cef()--*/
68   virtual CefRefPtr<CefBrowserHost> GetHost() =0;
69
70   ///
71   // Returns true if the browser can navigate backwards.
72   ///
73   /*--cef()--*/
74   virtual bool CanGoBack() =0;
75
76   ///
77   // Navigate backwards.
78   ///
79   /*--cef()--*/
80   virtual void GoBack() =0;
81
82   ///
83   // Returns true if the browser can navigate forwards.
84   ///
85   /*--cef()--*/
86   virtual bool CanGoForward() =0;
87
88   ///
89   // Navigate forwards.
90   ///
91   /*--cef()--*/
92   virtual void GoForward() =0;
93
94   ///
95   // Returns true if the browser is currently loading.
96   ///
97   /*--cef()--*/
98   virtual bool IsLoading() =0;
99
100   ///
101   // Reload the current page.
102   ///
103   /*--cef()--*/
104   virtual void Reload() =0;
105
106   ///
107   // Reload the current page ignoring any cached data.
108   ///
109   /*--cef()--*/
110   virtual void ReloadIgnoreCache() =0;
111
112   ///
113   // Stop loading the page.
114   ///
115   /*--cef()--*/
116   virtual void StopLoad() =0;
117
118   ///
119   // Returns the globally unique identifier for this browser.
120   ///
121   /*--cef()--*/
122   virtual int GetIdentifier() =0;
123
124   ///
125   // Returns true if this object is pointing to the same handle as |that|
126   // object.
127   ///
128   /*--cef()--*/
129   virtual bool IsSame(CefRefPtr<CefBrowser> that) =0;
130
131   ///
132   // Returns true if the window is a popup window.
133   ///
134   /*--cef()--*/
135   virtual bool IsPopup() =0;
136
137   ///
138   // Returns true if a document has been loaded in the browser.
139   ///
140   /*--cef()--*/
141   virtual bool HasDocument() =0;
142
143   ///
144   // Returns the main (top-level) frame for the browser window.
145   ///
146   /*--cef()--*/
147   virtual CefRefPtr<CefFrame> GetMainFrame() =0;
148
149   ///
150   // Returns the focused frame for the browser window.
151   ///
152   /*--cef()--*/
153   virtual CefRefPtr<CefFrame> GetFocusedFrame() =0;
154
155   ///
156   // Returns the frame with the specified identifier, or NULL if not found.
157   ///
158   /*--cef(capi_name=get_frame_byident)--*/
159   virtual CefRefPtr<CefFrame> GetFrame(int64 identifier) =0;
160
161   ///
162   // Returns the frame with the specified name, or NULL if not found.
163   ///
164   /*--cef(optional_param=name)--*/
165   virtual CefRefPtr<CefFrame> GetFrame(const CefString& name) =0;
166
167   ///
168   // Returns the number of frames that currently exist.
169   ///
170   /*--cef()--*/
171   virtual size_t GetFrameCount() =0;
172
173   ///
174   // Returns the identifiers of all existing frames.
175   ///
176   /*--cef(count_func=identifiers:GetFrameCount)--*/
177   virtual void GetFrameIdentifiers(std::vector<int64>& identifiers) =0;
178
179   ///
180   // Returns the names of all existing frames.
181   ///
182   /*--cef()--*/
183   virtual void GetFrameNames(std::vector<CefString>& names) =0;
184
185   ///
186   // Send a message to the specified |target_process|. Returns true if the
187   // message was sent successfully.
188   ///
189   /*--cef()--*/
190   virtual bool SendProcessMessage(CefProcessId target_process,
191                                   CefRefPtr<CefProcessMessage> message) =0;
192 };
193
194
195 ///
196 // Callback interface for CefBrowserHost::RunFileDialog. The methods of this
197 // class will be called on the browser process UI thread.
198 ///
199 /*--cef(source=client)--*/
200 class CefRunFileDialogCallback : public virtual CefBaseRefCounted {
201  public:
202   ///
203   // Called asynchronously after the file dialog is dismissed.
204   // |selected_accept_filter| is the 0-based index of the value selected from
205   // the accept filters array passed to CefBrowserHost::RunFileDialog.
206   // |file_paths| will be a single value or a list of values depending on the
207   // dialog mode. If the selection was cancelled |file_paths| will be empty.
208   ///
209   /*--cef(index_param=selected_accept_filter,optional_param=file_paths)--*/
210   virtual void OnFileDialogDismissed(
211       int selected_accept_filter,
212       const std::vector<CefString>& file_paths) =0;
213 };
214
215
216 ///
217 // Callback interface for CefBrowserHost::GetNavigationEntries. The methods of
218 // this class will be called on the browser process UI thread.
219 ///
220 /*--cef(source=client)--*/
221 class CefNavigationEntryVisitor : public virtual CefBaseRefCounted {
222  public:
223   ///
224   // Method that will be executed. Do not keep a reference to |entry| outside of
225   // this callback. Return true to continue visiting entries or false to stop.
226   // |current| is true if this entry is the currently loaded navigation entry.
227   // |index| is the 0-based index of this entry and |total| is the total number
228   // of entries.
229   ///
230   /*--cef()--*/
231   virtual bool Visit(CefRefPtr<CefNavigationEntry> entry,
232                      bool current,
233                      int index,
234                      int total) =0;
235 };
236
237
238 ///
239 // Callback interface for CefBrowserHost::PrintToPDF. The methods of this class
240 // will be called on the browser process UI thread.
241 ///
242 /*--cef(source=client)--*/
243 class CefPdfPrintCallback : public virtual CefBaseRefCounted {
244  public:
245   ///
246   // Method that will be executed when the PDF printing has completed. |path|
247   // is the output path. |ok| will be true if the printing completed
248   // successfully or false otherwise.
249   ///
250   /*--cef()--*/
251   virtual void OnPdfPrintFinished(const CefString& path, bool ok) =0;
252 };
253
254
255 ///
256 // Callback interface for CefBrowserHost::DownloadImage. The methods of this
257 // class will be called on the browser process UI thread.
258 ///
259 /*--cef(source=client)--*/
260 class CefDownloadImageCallback : public virtual CefBaseRefCounted {
261  public:
262   ///
263   // Method that will be executed when the image download has completed.
264   // |image_url| is the URL that was downloaded and |http_status_code| is the
265   // resulting HTTP status code. |image| is the resulting image, possibly at
266   // multiple scale factors, or empty if the download failed.
267   ///
268   /*--cef(optional_param=image)--*/
269   virtual void OnDownloadImageFinished(
270      const CefString& image_url,
271      int http_status_code,
272      CefRefPtr<CefImage> image) =0;
273 };
274
275
276 ///
277 // Class used to represent the browser process aspects of a browser window. The
278 // methods of this class can only be called in the browser process. They may be
279 // called on any thread in that process unless otherwise indicated in the
280 // comments.
281 ///
282 /*--cef(source=library)--*/
283 class CefBrowserHost : public virtual CefBaseRefCounted {
284  public:
285   typedef cef_drag_operations_mask_t DragOperationsMask;
286   typedef cef_file_dialog_mode_t FileDialogMode;
287   typedef cef_mouse_button_type_t MouseButtonType;
288   typedef cef_paint_element_type_t PaintElementType;
289
290   ///
291   // Create a new browser window using the window parameters specified by
292   // |windowInfo|. All values will be copied internally and the actual window
293   // will be created on the UI thread. If |request_context| is empty the
294   // global request context will be used. This method can be called on any
295   // browser process thread and will not block.
296   ///
297   /*--cef(optional_param=client,optional_param=url,
298           optional_param=request_context)--*/
299   static bool CreateBrowser(const CefWindowInfo& windowInfo,
300                             CefRefPtr<CefClient> client,
301                             const CefString& url,
302                             const CefBrowserSettings& settings,
303                             CefRefPtr<CefRequestContext> request_context);
304
305   ///
306   // Create a new browser window using the window parameters specified by
307   // |windowInfo|. If |request_context| is empty the global request context
308   // will be used. This method can only be called on the browser process UI
309   // thread.
310   ///
311   /*--cef(optional_param=client,optional_param=url,
312           optional_param=request_context)--*/
313   static CefRefPtr<CefBrowser> CreateBrowserSync(
314       const CefWindowInfo& windowInfo,
315       CefRefPtr<CefClient> client,
316       const CefString& url,
317       const CefBrowserSettings& settings,
318       CefRefPtr<CefRequestContext> request_context);
319
320   ///
321   // Returns the hosted browser object.
322   ///
323   /*--cef()--*/
324   virtual CefRefPtr<CefBrowser> GetBrowser() =0;
325
326   ///
327   // Request that the browser close. The JavaScript 'onbeforeunload' event will
328   // be fired. If |force_close| is false the event handler, if any, will be
329   // allowed to prompt the user and the user can optionally cancel the close.
330   // If |force_close| is true the prompt will not be displayed and the close
331   // will proceed. Results in a call to CefLifeSpanHandler::DoClose() if the
332   // event handler allows the close or if |force_close| is true. See
333   // CefLifeSpanHandler::DoClose() documentation for additional usage
334   // information.
335   ///
336   /*--cef()--*/
337   virtual void CloseBrowser(bool force_close) =0;
338
339   ///
340   // Helper for closing a browser. Call this method from the top-level window
341   // close handler. Internally this calls CloseBrowser(false) if the close has
342   // not yet been initiated. This method returns false while the close is
343   // pending and true after the close has completed. See CloseBrowser() and
344   // CefLifeSpanHandler::DoClose() documentation for additional usage
345   // information. This method must be called on the browser process UI thread.
346   ///
347   /*--cef()--*/
348   virtual bool TryCloseBrowser() =0;
349
350   ///
351   // Set whether the browser is focused.
352   ///
353   /*--cef()--*/
354   virtual void SetFocus(bool focus) =0;
355
356   ///
357   // Retrieve the window handle for this browser. If this browser is wrapped in
358   // a CefBrowserView this method should be called on the browser process UI
359   // thread and it will return the handle for the top-level native window.
360   ///
361   /*--cef()--*/
362   virtual CefWindowHandle GetWindowHandle() =0;
363
364   ///
365   // Retrieve the window handle of the browser that opened this browser. Will
366   // return NULL for non-popup windows or if this browser is wrapped in a
367   // CefBrowserView. This method can be used in combination with custom handling
368   // of modal windows. 
369   ///
370   /*--cef()--*/
371   virtual CefWindowHandle GetOpenerWindowHandle() =0;
372
373   ///
374   // Returns true if this browser is wrapped in a CefBrowserView.
375   ///
376   /*--cef()--*/
377   virtual bool HasView() =0;
378
379   ///
380   // Returns the client for this browser.
381   ///
382   /*--cef()--*/
383   virtual CefRefPtr<CefClient> GetClient() =0;
384
385   ///
386   // Returns the request context for this browser.
387   ///
388   /*--cef()--*/
389   virtual CefRefPtr<CefRequestContext> GetRequestContext() =0;
390
391   ///
392   // Get the current zoom level. The default zoom level is 0.0. This method can
393   // only be called on the UI thread.
394   ///
395   /*--cef()--*/
396   virtual double GetZoomLevel() =0;
397
398   ///
399   // Change the zoom level to the specified value. Specify 0.0 to reset the
400   // zoom level. If called on the UI thread the change will be applied
401   // immediately. Otherwise, the change will be applied asynchronously on the
402   // UI thread.
403   ///
404   /*--cef()--*/
405   virtual void SetZoomLevel(double zoomLevel) =0;
406
407   ///
408   // Call to run a file chooser dialog. Only a single file chooser dialog may be
409   // pending at any given time. |mode| represents the type of dialog to display.
410   // |title| to the title to be used for the dialog and may be empty to show the
411   // default title ("Open" or "Save" depending on the mode). |default_file_path|
412   // is the path with optional directory and/or file name component that will be
413   // initially selected in the dialog. |accept_filters| are used to restrict the
414   // selectable file types and may any combination of (a) valid lower-cased MIME
415   // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g.
416   // ".txt" or ".png"), or (c) combined description and file extension delimited
417   // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
418   // |selected_accept_filter| is the 0-based index of the filter that will be
419   // selected by default. |callback| will be executed after the dialog is
420   // dismissed or immediately if another dialog is already pending. The dialog
421   // will be initiated asynchronously on the UI thread.
422   ///
423   /*--cef(optional_param=title,optional_param=default_file_path,
424           optional_param=accept_filters,index_param=selected_accept_filter)--*/
425   virtual void RunFileDialog(FileDialogMode mode,
426                              const CefString& title,
427                              const CefString& default_file_path,
428                              const std::vector<CefString>& accept_filters,
429                              int selected_accept_filter,
430                              CefRefPtr<CefRunFileDialogCallback> callback) =0;
431
432   ///
433   // Download the file at |url| using CefDownloadHandler.
434   ///
435   /*--cef()--*/
436   virtual void StartDownload(const CefString& url) =0;
437
438   ///
439   // Download |image_url| and execute |callback| on completion with the images
440   // received from the renderer. If |is_favicon| is true then cookies are not
441   // sent and not accepted during download. Images with density independent
442   // pixel (DIP) sizes larger than |max_image_size| are filtered out from the
443   // image results. Versions of the image at different scale factors may be
444   // downloaded up to the maximum scale factor supported by the system. If there
445   // are no image results <= |max_image_size| then the smallest image is resized
446   // to |max_image_size| and is the only result. A |max_image_size| of 0 means
447   // unlimited. If |bypass_cache| is true then |image_url| is requested from the
448   // server even if it is present in the browser cache.
449   ///
450   /*--cef()--*/
451   virtual void DownloadImage(const CefString& image_url,
452                              bool is_favicon,
453                              uint32 max_image_size,
454                              bool bypass_cache,
455                              CefRefPtr<CefDownloadImageCallback> callback) =0;
456
457   ///
458   // Print the current browser contents.
459   ///
460   /*--cef()--*/
461   virtual void Print() =0;
462
463   ///
464   // Print the current browser contents to the PDF file specified by |path| and
465   // execute |callback| on completion. The caller is responsible for deleting
466   // |path| when done. For PDF printing to work on Linux you must implement the
467   // CefPrintHandler::GetPdfPaperSize method.
468   ///
469   /*--cef(optional_param=callback)--*/
470   virtual void PrintToPDF(const CefString& path,
471                           const CefPdfPrintSettings& settings,
472                           CefRefPtr<CefPdfPrintCallback> callback) =0;
473
474   ///
475   // Search for |searchText|. |identifier| can be used to have multiple searches
476   // running simultaniously. |forward| indicates whether to search forward or
477   // backward within the page. |matchCase| indicates whether the search should
478   // be case-sensitive. |findNext| indicates whether this is the first request
479   // or a follow-up. The CefFindHandler instance, if any, returned via
480   // CefClient::GetFindHandler will be called to report find results.
481   ///
482   /*--cef()--*/
483   virtual void Find(int identifier, const CefString& searchText,
484                     bool forward, bool matchCase, bool findNext) =0;
485
486   ///
487   // Cancel all searches that are currently going on.
488   ///
489   /*--cef()--*/
490   virtual void StopFinding(bool clearSelection) =0;
491
492   ///
493   // Open developer tools (DevTools) in its own browser. The DevTools browser
494   // will remain associated with this browser. If the DevTools browser is
495   // already open then it will be focused, in which case the |windowInfo|,
496   // |client| and |settings| parameters will be ignored. If |inspect_element_at|
497   // is non-empty then the element at the specified (x,y) location will be
498   // inspected. The |windowInfo| parameter will be ignored if this browser is
499   // wrapped in a CefBrowserView.
500   ///
501   /*--cef(optional_param=windowInfo,optional_param=client,
502           optional_param=settings,optional_param=inspect_element_at)--*/
503   virtual void ShowDevTools(const CefWindowInfo& windowInfo,
504                             CefRefPtr<CefClient> client,
505                             const CefBrowserSettings& settings,
506                             const CefPoint& inspect_element_at) =0;
507
508   ///
509   // Explicitly close the associated DevTools browser, if any.
510   ///
511   /*--cef()--*/
512   virtual void CloseDevTools() =0;
513
514   ///
515   // Returns true if this browser currently has an associated DevTools browser.
516   // Must be called on the browser process UI thread.
517   ///
518   /*--cef()--*/
519   virtual bool HasDevTools() =0;
520
521   ///
522   // Retrieve a snapshot of current navigation entries as values sent to the
523   // specified visitor. If |current_only| is true only the current navigation
524   // entry will be sent, otherwise all navigation entries will be sent.
525   ///
526   /*--cef()--*/
527   virtual void GetNavigationEntries(
528       CefRefPtr<CefNavigationEntryVisitor> visitor,
529       bool current_only) =0;
530
531   ///
532   // Set whether mouse cursor change is disabled.
533   ///
534   /*--cef()--*/
535   virtual void SetMouseCursorChangeDisabled(bool disabled) =0;
536
537   ///
538   // Returns true if mouse cursor change is disabled.
539   ///
540   /*--cef()--*/
541   virtual bool IsMouseCursorChangeDisabled() =0;
542
543   ///
544   // If a misspelled word is currently selected in an editable node calling
545   // this method will replace it with the specified |word|.
546   ///
547   /*--cef()--*/
548   virtual void ReplaceMisspelling(const CefString& word) =0;
549
550   ///
551   // Add the specified |word| to the spelling dictionary.
552   ///
553   /*--cef()--*/
554   virtual void AddWordToDictionary(const CefString& word) =0;
555
556   ///
557   // Returns true if window rendering is disabled.
558   ///
559   /*--cef()--*/
560   virtual bool IsWindowRenderingDisabled() =0;
561
562   ///
563   // Notify the browser that the widget has been resized. The browser will first
564   // call CefRenderHandler::GetViewRect to get the new size and then call
565   // CefRenderHandler::OnPaint asynchronously with the updated regions. This
566   // method is only used when window rendering is disabled.
567   ///
568   /*--cef()--*/
569   virtual void WasResized() =0;
570
571   ///
572   // Notify the browser that it has been hidden or shown. Layouting and
573   // CefRenderHandler::OnPaint notification will stop when the browser is
574   // hidden. This method is only used when window rendering is disabled.
575   ///
576   /*--cef()--*/
577   virtual void WasHidden(bool hidden) =0;
578
579   ///
580   // Send a notification to the browser that the screen info has changed. The
581   // browser will then call CefRenderHandler::GetScreenInfo to update the
582   // screen information with the new values. This simulates moving the webview
583   // window from one display to another, or changing the properties of the
584   // current display. This method is only used when window rendering is
585   // disabled.
586   ///
587   /*--cef()--*/
588   virtual void NotifyScreenInfoChanged() =0;
589
590   ///
591   // Invalidate the view. The browser will call CefRenderHandler::OnPaint
592   // asynchronously. This method is only used when window rendering is
593   // disabled.
594   ///
595   /*--cef()--*/
596   virtual void Invalidate(PaintElementType type) =0;
597
598   ///
599   // Send a key event to the browser.
600   ///
601   /*--cef()--*/
602   virtual void SendKeyEvent(const CefKeyEvent& event) =0;
603
604   ///
605   // Send a mouse click event to the browser. The |x| and |y| coordinates are
606   // relative to the upper-left corner of the view.
607   ///
608   /*--cef()--*/
609   virtual void SendMouseClickEvent(const CefMouseEvent& event,
610                                    MouseButtonType type,
611                                    bool mouseUp, int clickCount) =0;
612
613   ///
614   // Send a mouse move event to the browser. The |x| and |y| coordinates are
615   // relative to the upper-left corner of the view.
616   ///
617   /*--cef()--*/
618   virtual void SendMouseMoveEvent(const CefMouseEvent& event,
619                                   bool mouseLeave) =0;
620
621   ///
622   // Send a mouse wheel event to the browser. The |x| and |y| coordinates are
623   // relative to the upper-left corner of the view. The |deltaX| and |deltaY|
624   // values represent the movement delta in the X and Y directions respectively.
625   // In order to scroll inside select popups with window rendering disabled
626   // CefRenderHandler::GetScreenPoint should be implemented properly.
627   ///
628   /*--cef()--*/
629   virtual void SendMouseWheelEvent(const CefMouseEvent& event,
630                                    int deltaX, int deltaY) =0;
631
632   ///
633   // Send a focus event to the browser.
634   ///
635   /*--cef()--*/
636   virtual void SendFocusEvent(bool setFocus) =0;
637
638   ///
639   // Send a capture lost event to the browser.
640   ///
641   /*--cef()--*/
642   virtual void SendCaptureLostEvent() =0;
643
644   ///
645   // Notify the browser that the window hosting it is about to be moved or
646   // resized. This method is only used on Windows and Linux.
647   ///
648   /*--cef()--*/
649   virtual void NotifyMoveOrResizeStarted() =0;
650
651   ///
652   // Returns the maximum rate in frames per second (fps) that CefRenderHandler::
653   // OnPaint will be called for a windowless browser. The actual fps may be
654   // lower if the browser cannot generate frames at the requested rate. The
655   // minimum value is 1 and the maximum value is 60 (default 30). This method
656   // can only be called on the UI thread.
657   ///
658   /*--cef()--*/
659   virtual int GetWindowlessFrameRate() =0;
660
661   ///
662   // Set the maximum rate in frames per second (fps) that CefRenderHandler::
663   // OnPaint will be called for a windowless browser. The actual fps may be
664   // lower if the browser cannot generate frames at the requested rate. The
665   // minimum value is 1 and the maximum value is 60 (default 30). Can also be
666   // set at browser creation via CefBrowserSettings.windowless_frame_rate.
667   ///
668   /*--cef()--*/
669   virtual void SetWindowlessFrameRate(int frame_rate) =0;
670
671   ///
672   // Begins a new composition or updates the existing composition. Blink has a
673   // special node (a composition node) that allows the input method to change
674   // text without affecting other DOM nodes. |text| is the optional text that
675   // will be inserted into the composition node. |underlines| is an optional set
676   // of ranges that will be underlined in the resulting text.
677   // |replacement_range| is an optional range of the existing text that will be
678   // replaced. |selection_range| is an optional range of the resulting text that
679   // will be selected after insertion or replacement. The |replacement_range|
680   // value is only used on OS X.
681   //
682   // This method may be called multiple times as the composition changes. When
683   // the client is done making changes the composition should either be canceled
684   // or completed. To cancel the composition call ImeCancelComposition. To
685   // complete the composition call either ImeCommitText or
686   // ImeFinishComposingText. Completion is usually signaled when:
687   //   A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
688   //      flag (on Windows), or;
689   //   B. The client receives a "commit" signal of GtkIMContext (on Linux), or;
690   //   C. insertText of NSTextInput is called (on Mac).
691   //
692   // This method is only used when window rendering is disabled.
693   ///
694   /*--cef(optional_param=text, optional_param=underlines)--*/
695   virtual void ImeSetComposition(
696       const CefString& text,
697       const std::vector<CefCompositionUnderline>& underlines,
698       const CefRange& replacement_range,
699       const CefRange& selection_range) =0;
700
701   ///
702   // Completes the existing composition by optionally inserting the specified
703   // |text| into the composition node. |replacement_range| is an optional range
704   // of the existing text that will be replaced. |relative_cursor_pos| is where
705   // the cursor will be positioned relative to the current cursor position. See
706   // comments on ImeSetComposition for usage. The |replacement_range| and
707   // |relative_cursor_pos| values are only used on OS X.
708   // This method is only used when window rendering is disabled.
709   ///
710   /*--cef(optional_param=text)--*/
711   virtual void ImeCommitText(const CefString& text,
712                              const CefRange& replacement_range,
713                              int relative_cursor_pos) =0;
714
715   ///
716   // Completes the existing composition by applying the current composition node
717   // contents. If |keep_selection| is false the current selection, if any, will
718   // be discarded. See comments on ImeSetComposition for usage.
719   // This method is only used when window rendering is disabled.
720   ///
721   /*--cef()--*/
722   virtual void ImeFinishComposingText(bool keep_selection) =0;
723
724   ///
725   // Cancels the existing composition and discards the composition node
726   // contents without applying them. See comments on ImeSetComposition for
727   // usage.
728   // This method is only used when window rendering is disabled.
729   ///
730   /*--cef()--*/
731   virtual void ImeCancelComposition() =0;
732
733   ///
734   // Call this method when the user drags the mouse into the web view (before
735   // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop).
736   // |drag_data| should not contain file contents as this type of data is not
737   // allowed to be dragged into the web view. File contents can be removed using
738   // CefDragData::ResetFileContents (for example, if |drag_data| comes from
739   // CefRenderHandler::StartDragging).
740   // This method is only used when window rendering is disabled.
741   ///
742   /*--cef()--*/
743   virtual void DragTargetDragEnter(CefRefPtr<CefDragData> drag_data,
744                                   const CefMouseEvent& event,
745                                   DragOperationsMask allowed_ops) =0;
746
747   ///
748   // Call this method each time the mouse is moved across the web view during
749   // a drag operation (after calling DragTargetDragEnter and before calling
750   // DragTargetDragLeave/DragTargetDrop).
751   // This method is only used when window rendering is disabled.
752   ///
753   /*--cef()--*/
754   virtual void DragTargetDragOver(const CefMouseEvent& event,
755                                   DragOperationsMask allowed_ops) =0;
756
757   ///
758   // Call this method when the user drags the mouse out of the web view (after
759   // calling DragTargetDragEnter).
760   // This method is only used when window rendering is disabled.
761   ///
762   /*--cef()--*/
763   virtual void DragTargetDragLeave() =0;
764
765   ///
766   // Call this method when the user completes the drag operation by dropping
767   // the object onto the web view (after calling DragTargetDragEnter).
768   // The object being dropped is |drag_data|, given as an argument to
769   // the previous DragTargetDragEnter call.
770   // This method is only used when window rendering is disabled.
771   ///
772   /*--cef()--*/
773   virtual void DragTargetDrop(const CefMouseEvent& event) =0;
774
775   ///
776   // Call this method when the drag operation started by a
777   // CefRenderHandler::StartDragging call has ended either in a drop or
778   // by being cancelled. |x| and |y| are mouse coordinates relative to the
779   // upper-left corner of the view. If the web view is both the drag source
780   // and the drag target then all DragTarget* methods should be called before
781   // DragSource* mthods.
782   // This method is only used when window rendering is disabled.
783   ///
784   /*--cef()--*/
785   virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) =0;
786
787   ///
788   // Call this method when the drag operation started by a
789   // CefRenderHandler::StartDragging call has completed. This method may be
790   // called immediately without first calling DragSourceEndedAt to cancel a
791   // drag operation. If the web view is both the drag source and the drag
792   // target then all DragTarget* methods should be called before DragSource*
793   // mthods.
794   // This method is only used when window rendering is disabled.
795   ///
796   /*--cef()--*/
797   virtual void DragSourceSystemDragEnded() =0;
798
799   ///
800   // Returns the current visible navigation entry for this browser. This method
801   // can only be called on the UI thread.
802   ///
803   /*--cef()--*/
804   virtual CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() =0;
805 };
806
807 #endif  // CEF_INCLUDE_CEF_BROWSER_H_