Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 3.2883.1542.gf264ab9
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefBrowserHost

CefBase
   |
   +--CefBrowserHost

   in cef_browser.h

class CefBrowserHost
extends CefBase

Class used to represent the browser process aspects of a browser window. The methods of this class can only be called in the browser process. They may be called on any thread in that process unless otherwise indicated in the comments.


Inner Classes, Typedefs, and Enums
typedef CefBrowserHost::DragOperationsMask
          
typedef CefBrowserHost::FileDialogMode
          
typedef CefBrowserHost::MouseButtonType
          
typedef CefBrowserHost::PaintElementType
          
 
Method Summary
 virtual void AddWordToDictionary( const CefString& word )= 0
          Add the specified |word| to the spelling dictionary.
 virtual void CloseBrowser( bool force_close )= 0
          Request that the browser close.
 virtual void CloseDevTools()= 0
          Explicitly close the associated DevTools browser, if any.
 static bool CreateBrowser( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefString& url, const CefBrowserSettings& settings, CefRefPtr< CefRequestContext > request_context )
          Create a new browser window using the window parameters specified by |windowInfo|.
 static CefRefPtr< CefBrowser > CreateBrowserSync( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefString& url, const CefBrowserSettings& settings, CefRefPtr< CefRequestContext > request_context )
          Create a new browser window using the window parameters specified by |windowInfo|.
 virtual void DownloadImage( const CefString& image_url, bool is_favicon, uint32 max_image_size, bool bypass_cache, CefRefPtr< CefDownloadImageCallback > callback )= 0
          Download |image_url| and execute |callback| on completion with the images received from the renderer.
 virtual void DragSourceEndedAt( int x, int y, CefBrowserHost::DragOperationsMask op )= 0
          Call this method when the drag operation started by a CefRenderHandler::StartDragging call has ended either in a drop or by being cancelled.
 virtual void DragSourceSystemDragEnded()= 0
          Call this method when the drag operation started by a CefRenderHandler::StartDragging call has completed.
 virtual void DragTargetDragEnter( CefRefPtr< CefDragData > drag_data, const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops )= 0
          Call this method when the user drags the mouse into the web view (before calling DragTargetDragOver/DragTargetLeave/DragTargetDrop).
 virtual void DragTargetDragLeave()= 0
          Call this method when the user drags the mouse out of the web view (after calling DragTargetDragEnter).
 virtual void DragTargetDragOver( const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops )= 0
          Call this method each time the mouse is moved across the web view during a drag operation (after calling DragTargetDragEnter and before calling DragTargetDragLeave/DragTargetDrop).
 virtual void DragTargetDrop( const CefMouseEvent& event )= 0
          Call this method when the user completes the drag operation by dropping the object onto the web view (after calling DragTargetDragEnter).
 virtual void Find( int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext )= 0
          Search for |searchText|.
 virtual CefRefPtr< CefBrowser > GetBrowser()= 0
          Returns the hosted browser object.
 virtual CefRefPtr< CefClient > GetClient()= 0
          Returns the client for this browser.
 virtual void GetNavigationEntries( CefRefPtr< CefNavigationEntryVisitor > visitor, bool current_only )= 0
          Retrieve a snapshot of current navigation entries as values sent to the specified visitor.
 virtual CefWindowHandle GetOpenerWindowHandle()= 0
          Retrieve the window handle of the browser that opened this browser.
 virtual CefRefPtr< CefRequestContext > GetRequestContext()= 0
          Returns the request context for this browser.
 virtual CefRefPtr< CefNavigationEntry > GetVisibleNavigationEntry()= 0
          Returns the current visible navigation entry for this browser.
 virtual CefWindowHandle GetWindowHandle()= 0
          Retrieve the window handle for this browser.
 virtual int GetWindowlessFrameRate()= 0
          Returns the maximum rate in frames per second (fps) that CefRenderHandler:: OnPaint will be called for a windowless browser.
 virtual double GetZoomLevel()= 0
          Get the current zoom level.
 virtual bool HasDevTools()= 0
          Returns true if this browser currently has an associated DevTools browser.
 virtual bool HasView()= 0
          Returns true if this browser is wrapped in a CefBrowserView.
 virtual void ImeCancelComposition()= 0
          Cancels the existing composition and discards the composition node contents without applying them.
 virtual void ImeCommitText( const CefString& text, const CefRange& replacement_range, int relative_cursor_pos )= 0
          Completes the existing composition by optionally inserting the specified |text| into the composition node.
 virtual void ImeFinishComposingText( bool keep_selection )= 0
          Completes the existing composition by applying the current composition node contents.
 virtual void ImeSetComposition( const CefString& text, const std::vector< CefCompositionUnderline >& underlines, const CefRange& replacement_range, const CefRange& selection_range )= 0
          Begins a new composition or updates the existing composition.
 virtual void Invalidate( CefBrowserHost::PaintElementType type )= 0
          Invalidate the view.
 virtual bool IsMouseCursorChangeDisabled()= 0
          Returns true if mouse cursor change is disabled.
 virtual bool IsWindowRenderingDisabled()= 0
          Returns true if window rendering is disabled.
 virtual void NotifyMoveOrResizeStarted()= 0
          Notify the browser that the window hosting it is about to be moved or resized.
 virtual void NotifyScreenInfoChanged()= 0
          Send a notification to the browser that the screen info has changed.
 virtual void Print()= 0
          Print the current browser contents.
 virtual void PrintToPDF( const CefString& path, const CefPdfPrintSettings& settings, CefRefPtr< CefPdfPrintCallback > callback )= 0
          Print the current browser contents to the PDF file specified by |path| and execute |callback| on completion.
 virtual void ReplaceMisspelling( const CefString& word )= 0
          If a misspelled word is currently selected in an editable node calling this method will replace it with the specified |word|.
 virtual void RunFileDialog( CefBrowserHost::FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector< CefString >& accept_filters, int selected_accept_filter, CefRefPtr< CefRunFileDialogCallback > callback )= 0
          Call to run a file chooser dialog.
 virtual void SendCaptureLostEvent()= 0
          Send a capture lost event to the browser.
 virtual void SendFocusEvent( bool setFocus )= 0
          Send a focus event to the browser.
 virtual void SendKeyEvent( const CefKeyEvent& event )= 0
          Send a key event to the browser.
 virtual void SendMouseClickEvent( const CefMouseEvent& event, CefBrowserHost::MouseButtonType type, bool mouseUp, int clickCount )= 0
          Send a mouse click event to the browser.
 virtual void SendMouseMoveEvent( const CefMouseEvent& event, bool mouseLeave )= 0
          Send a mouse move event to the browser.
 virtual void SendMouseWheelEvent( const CefMouseEvent& event, int deltaX, int deltaY )= 0
          Send a mouse wheel event to the browser.
 virtual void SetFocus( bool focus )= 0
          Set whether the browser is focused.
 virtual void SetMouseCursorChangeDisabled( bool disabled )= 0
          Set whether mouse cursor change is disabled.
 virtual void SetWindowlessFrameRate( int frame_rate )= 0
          Set the maximum rate in frames per second (fps) that CefRenderHandler:: OnPaint will be called for a windowless browser.
 virtual void SetZoomLevel( double zoomLevel )= 0
          Change the zoom level to the specified value.
 virtual void ShowDevTools( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefBrowserSettings& settings, const CefPoint& inspect_element_at )= 0
          Open developer tools (DevTools) in its own browser.
 virtual void StartDownload( const CefString& url )= 0
          Download the file at |url| using CefDownloadHandler.
 virtual void StopFinding( bool clearSelection )= 0
          Cancel all searches that are currently going on.
 virtual bool TryCloseBrowser()= 0
          Helper for closing a browser.
 virtual void WasHidden( bool hidden )= 0
          Notify the browser that it has been hidden or shown.
 virtual void WasResized()= 0
          Notify the browser that the widget has been resized.
   
Methods inherited from class CefBase
AddRef, Release, HasOneRef
 

Method Detail

AddWordToDictionary

public virtual void AddWordToDictionary( const CefString& word )= 0;
Add the specified |word| to the spelling dictionary.

CloseBrowser

public virtual void CloseBrowser( bool force_close )= 0;
Request that the browser close. The JavaScript 'onbeforeunload' event will be fired. If |force_close| is false the event handler, if any, will be allowed to prompt the user and the user can optionally cancel the close. If |force_close| is true the prompt will not be displayed and the close will proceed. Results in a call to CefLifeSpanHandler::DoClose() if the event handler allows the close or if |force_close| is true. See CefLifeSpanHandler::DoClose() documentation for additional usage information.

CloseDevTools

public virtual void CloseDevTools()= 0;
Explicitly close the associated DevTools browser, if any.

CreateBrowser

public static bool CreateBrowser( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefString& url, const CefBrowserSettings& settings, CefRefPtr< CefRequestContext > request_context );
Create a new browser window using the window parameters specified by |windowInfo|. All values will be copied internally and the actual window will be created on the UI thread. If |request_context| is empty the global request context will be used. This method can be called on any browser process thread and will not block.

CreateBrowserSync

public static CefRefPtr< CefBrowser > CreateBrowserSync( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefString& url, const CefBrowserSettings& settings, CefRefPtr< CefRequestContext > request_context );
Create a new browser window using the window parameters specified by |windowInfo|. If |request_context| is empty the global request context will be used. This method can only be called on the browser process UI thread.

DownloadImage

public virtual void DownloadImage( const CefString& image_url, bool is_favicon, uint32 max_image_size, bool bypass_cache, CefRefPtr< CefDownloadImageCallback > callback )= 0;
Download |image_url| and execute |callback| on completion with the images received from the renderer. If |is_favicon| is true then cookies are not sent and not accepted during download. Images with density independent pixel (DIP) sizes larger than |max_image_size| are filtered out from the image results. Versions of the image at different scale factors may be downloaded up to the maximum scale factor supported by the system. If there are no image results <= |max_image_size| then the smallest image is resized to |max_image_size| and is the only result. A |max_image_size| of 0 means unlimited. If |bypass_cache| is true then |image_url| is requested from the server even if it is present in the browser cache.

DragSourceEndedAt

public virtual void DragSourceEndedAt( int x, int y, CefBrowserHost::DragOperationsMask op )= 0;
Call this method when the drag operation started by a CefRenderHandler::StartDragging call has ended either in a drop or by being cancelled. |x| and |y| are mouse coordinates relative to the upper-left corner of the view. If the web view is both the drag source and the drag target then all DragTarget* methods should be called before DragSource* mthods. This method is only used when window rendering is disabled.

DragSourceSystemDragEnded

public virtual void DragSourceSystemDragEnded()= 0;
Call this method when the drag operation started by a CefRenderHandler::StartDragging call has completed. This method may be called immediately without first calling DragSourceEndedAt to cancel a drag operation. If the web view is both the drag source and the drag target then all DragTarget* methods should be called before DragSource* mthods. This method is only used when window rendering is disabled.

DragTargetDragEnter

public virtual void DragTargetDragEnter( CefRefPtr< CefDragData > drag_data, const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops )= 0;
Call this method when the user drags the mouse into the web view (before calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| should not contain file contents as this type of data is not allowed to be dragged into the web view. File contents can be removed using CefDragData::ResetFileContents (for example, if |drag_data| comes from CefRenderHandler::StartDragging). This method is only used when window rendering is disabled.

DragTargetDragLeave

public virtual void DragTargetDragLeave()= 0;
Call this method when the user drags the mouse out of the web view (after calling DragTargetDragEnter). This method is only used when window rendering is disabled.

DragTargetDragOver

public virtual void DragTargetDragOver( const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops )= 0;
Call this method each time the mouse is moved across the web view during a drag operation (after calling DragTargetDragEnter and before calling DragTargetDragLeave/DragTargetDrop). This method is only used when window rendering is disabled.

DragTargetDrop

public virtual void DragTargetDrop( const CefMouseEvent& event )= 0;
Call this method when the user completes the drag operation by dropping the object onto the web view (after calling DragTargetDragEnter). The object being dropped is |drag_data|, given as an argument to the previous DragTargetDragEnter call. This method is only used when window rendering is disabled.

Find

public virtual void Find( int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext )= 0;
Search for |searchText|. |identifier| can be used to have multiple searches running simultaniously. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up. The CefFindHandler instance, if any, returned via CefClient::GetFindHandler will be called to report find results.

GetBrowser

public virtual CefRefPtr< CefBrowser > GetBrowser()= 0;
Returns the hosted browser object.

GetClient

public virtual CefRefPtr< CefClient > GetClient()= 0;
Returns the client for this browser.

GetNavigationEntries

public virtual void GetNavigationEntries( CefRefPtr< CefNavigationEntryVisitor > visitor, bool current_only )= 0;
Retrieve a snapshot of current navigation entries as values sent to the specified visitor. If |current_only| is true only the current navigation entry will be sent, otherwise all navigation entries will be sent.

GetOpenerWindowHandle

public virtual CefWindowHandle GetOpenerWindowHandle()= 0;
Retrieve the window handle of the browser that opened this browser. Will return NULL for non-popup windows or if this browser is wrapped in a CefBrowserView. This method can be used in combination with custom handling of modal windows.

GetRequestContext

public virtual CefRefPtr< CefRequestContext > GetRequestContext()= 0;
Returns the request context for this browser.

GetVisibleNavigationEntry

public virtual CefRefPtr< CefNavigationEntry > GetVisibleNavigationEntry()= 0;
Returns the current visible navigation entry for this browser. This method can only be called on the UI thread.

GetWindowHandle

public virtual CefWindowHandle GetWindowHandle()= 0;
Retrieve the window handle for this browser. If this browser is wrapped in a CefBrowserView this method should be called on the browser process UI thread and it will return the handle for the top-level native window.

GetWindowlessFrameRate

public virtual int GetWindowlessFrameRate()= 0;
Returns the maximum rate in frames per second (fps) that CefRenderHandler:: OnPaint will be called for a windowless browser. The actual fps may be lower if the browser cannot generate frames at the requested rate. The minimum value is 1 and the maximum value is 60 (default 30). This method can only be called on the UI thread.

GetZoomLevel

public virtual double GetZoomLevel()= 0;
Get the current zoom level. The default zoom level is 0.0. This method can only be called on the UI thread.

HasDevTools

public virtual bool HasDevTools()= 0;
Returns true if this browser currently has an associated DevTools browser. Must be called on the browser process UI thread.

HasView

public virtual bool HasView()= 0;
Returns true if this browser is wrapped in a CefBrowserView.

ImeCancelComposition

public virtual void ImeCancelComposition()= 0;
Cancels the existing composition and discards the composition node contents without applying them. See comments on ImeSetComposition for usage. This method is only used when window rendering is disabled.

ImeCommitText

public virtual void ImeCommitText( const CefString& text, const CefRange& replacement_range, int relative_cursor_pos )= 0;
Completes the existing composition by optionally inserting the specified |text| into the composition node. |replacement_range| is an optional range of the existing text that will be replaced. |relative_cursor_pos| is where the cursor will be positioned relative to the current cursor position. See comments on ImeSetComposition for usage. The |replacement_range| and |relative_cursor_pos| values are only used on OS X. This method is only used when window rendering is disabled.

ImeFinishComposingText

public virtual void ImeFinishComposingText( bool keep_selection )= 0;
Completes the existing composition by applying the current composition node contents. If |keep_selection| is false the current selection, if any, will be discarded. See comments on ImeSetComposition for usage. This method is only used when window rendering is disabled.

ImeSetComposition

public virtual void ImeSetComposition( const CefString& text, const std::vector< CefCompositionUnderline >& underlines, const CefRange& replacement_range, const CefRange& selection_range )= 0;
Begins a new composition or updates the existing composition. Blink has a special node (a composition node) that allows the input method to change text without affecting other DOM nodes. |text| is the optional text that will be inserted into the composition node. |underlines| is an optional set of ranges that will be underlined in the resulting text. |replacement_range| is an optional range of the existing text that will be replaced. |selection_range| is an optional range of the resulting text that will be selected after insertion or replacement. The |replacement_range| value is only used on OS X. This method may be called multiple times as the composition changes. When the client is done making changes the composition should either be canceled or completed. To cancel the composition call ImeCancelComposition. To complete the composition call either ImeCommitText or ImeFinishComposingText. Completion is usually signaled when: A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag (on Windows), or; B. The client receives a "commit" signal of GtkIMContext (on Linux), or; C. insertText of NSTextInput is called (on Mac). This method is only used when window rendering is disabled.

Invalidate

public virtual void Invalidate( CefBrowserHost::PaintElementType type )= 0;
Invalidate the view. The browser will call CefRenderHandler::OnPaint asynchronously. This method is only used when window rendering is disabled.

IsMouseCursorChangeDisabled

public virtual bool IsMouseCursorChangeDisabled()= 0;
Returns true if mouse cursor change is disabled.

IsWindowRenderingDisabled

public virtual bool IsWindowRenderingDisabled()= 0;
Returns true if window rendering is disabled.

NotifyMoveOrResizeStarted

public virtual void NotifyMoveOrResizeStarted()= 0;
Notify the browser that the window hosting it is about to be moved or resized. This method is only used on Windows and Linux.

NotifyScreenInfoChanged

public virtual void NotifyScreenInfoChanged()= 0;
Send a notification to the browser that the screen info has changed. The browser will then call CefRenderHandler::GetScreenInfo to update the screen information with the new values. This simulates moving the webview window from one display to another, or changing the properties of the current display. This method is only used when window rendering is disabled.

Print

public virtual void Print()= 0;
Print the current browser contents.

PrintToPDF

public virtual void PrintToPDF( const CefString& path, const CefPdfPrintSettings& settings, CefRefPtr< CefPdfPrintCallback > callback )= 0;
Print the current browser contents to the PDF file specified by |path| and execute |callback| on completion. The caller is responsible for deleting |path| when done. For PDF printing to work on Linux you must implement the CefPrintHandler::GetPdfPaperSize method.

ReplaceMisspelling

public virtual void ReplaceMisspelling( const CefString& word )= 0;
If a misspelled word is currently selected in an editable node calling this method will replace it with the specified |word|.

RunFileDialog

public virtual void RunFileDialog( CefBrowserHost::FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector< CefString >& accept_filters, int selected_accept_filter, CefRefPtr< CefRunFileDialogCallback > callback )= 0;
Call to run a file chooser dialog. Only a single file chooser dialog may be pending at any given time. |mode| represents the type of dialog to display. |title| to the title to be used for the dialog and may be empty to show the default title ("Open" or "Save" depending on the mode). |default_file_path| is the path with optional directory and/or file name component that will be initially selected in the dialog. |accept_filters| are used to restrict the selectable file types and may any combination of (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c) combined description and file extension delimited using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of the filter that will be selected by default. |callback| will be executed after the dialog is dismissed or immediately if another dialog is already pending. The dialog will be initiated asynchronously on the UI thread.

SendCaptureLostEvent

public virtual void SendCaptureLostEvent()= 0;
Send a capture lost event to the browser.

SendFocusEvent

public virtual void SendFocusEvent( bool setFocus )= 0;
Send a focus event to the browser.

SendKeyEvent

public virtual void SendKeyEvent( const CefKeyEvent& event )= 0;
Send a key event to the browser.

SendMouseClickEvent

public virtual void SendMouseClickEvent( const CefMouseEvent& event, CefBrowserHost::MouseButtonType type, bool mouseUp, int clickCount )= 0;
Send a mouse click event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

SendMouseMoveEvent

public virtual void SendMouseMoveEvent( const CefMouseEvent& event, bool mouseLeave )= 0;
Send a mouse move event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

SendMouseWheelEvent

public virtual void SendMouseWheelEvent( const CefMouseEvent& event, int deltaX, int deltaY )= 0;
Send a mouse wheel event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view. The |deltaX| and |deltaY| values represent the movement delta in the X and Y directions respectively. In order to scroll inside select popups with window rendering disabled CefRenderHandler::GetScreenPoint should be implemented properly.

SetFocus

public virtual void SetFocus( bool focus )= 0;
Set whether the browser is focused.

SetMouseCursorChangeDisabled

public virtual void SetMouseCursorChangeDisabled( bool disabled )= 0;
Set whether mouse cursor change is disabled.

SetWindowlessFrameRate

public virtual void SetWindowlessFrameRate( int frame_rate )= 0;
Set the maximum rate in frames per second (fps) that CefRenderHandler:: OnPaint will be called for a windowless browser. The actual fps may be lower if the browser cannot generate frames at the requested rate. The minimum value is 1 and the maximum value is 60 (default 30). Can also be set at browser creation via CefBrowserSettings.windowless_frame_rate.

SetZoomLevel

public virtual void SetZoomLevel( double zoomLevel )= 0;
Change the zoom level to the specified value. Specify 0.0 to reset the zoom level. If called on the UI thread the change will be applied immediately. Otherwise, the change will be applied asynchronously on the UI thread.

ShowDevTools

public virtual void ShowDevTools( const CefWindowInfo& windowInfo, CefRefPtr< CefClient > client, const CefBrowserSettings& settings, const CefPoint& inspect_element_at )= 0;
Open developer tools (DevTools) in its own browser. The DevTools browser will remain associated with this browser. If the DevTools browser is already open then it will be focused, in which case the |windowInfo|, |client| and |settings| parameters will be ignored. If |inspect_element_at| is non-empty then the element at the specified (x,y) location will be inspected. The |windowInfo| parameter will be ignored if this browser is wrapped in a CefBrowserView.

StartDownload

public virtual void StartDownload( const CefString& url )= 0;
Download the file at |url| using CefDownloadHandler.

StopFinding

public virtual void StopFinding( bool clearSelection )= 0;
Cancel all searches that are currently going on.

TryCloseBrowser

public virtual bool TryCloseBrowser()= 0;
Helper for closing a browser. Call this method from the top-level window close handler. Internally this calls CloseBrowser(false) if the close has not yet been initiated. This method returns false while the close is pending and true after the close has completed. See CloseBrowser() and CefLifeSpanHandler::DoClose() documentation for additional usage information. This method must be called on the browser process UI thread.

WasHidden

public virtual void WasHidden( bool hidden )= 0;
Notify the browser that it has been hidden or shown. Layouting and CefRenderHandler::OnPaint notification will stop when the browser is hidden. This method is only used when window rendering is disabled.

WasResized

public virtual void WasResized()= 0;
Notify the browser that the widget has been resized. The browser will first call CefRenderHandler::GetViewRect to get the new size and then call CefRenderHandler::OnPaint asynchronously with the updated regions. This method is only used when window rendering is disabled.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 3.2883.1542.gf264ab9
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt