Chromium Embedded Framework (CEF)  126.2.0+g5c56e98+chromium-126.0.6478.62
CefBrowserViewDelegate Class Reference

Implement this interface to handle BrowserView events. More...

#include "include/views/cef_browser_view_delegate.h"

Inheritance diagram for CefBrowserViewDelegate:
CefViewDelegate CefBaseRefCounted

Public Types

typedef cef_chrome_toolbar_type_t ChromeToolbarType
 

Public Member Functions

virtual void OnBrowserCreated (CefRefPtr< CefBrowserView > browser_view, CefRefPtr< CefBrowser > browser)
 Called when |browser| associated with |browser_view| is created. More...
 
virtual void OnBrowserDestroyed (CefRefPtr< CefBrowserView > browser_view, CefRefPtr< CefBrowser > browser)
 Called when |browser| associated with |browser_view| is destroyed. More...
 
virtual CefRefPtr< CefBrowserViewDelegateGetDelegateForPopupBrowserView (CefRefPtr< CefBrowserView > browser_view, const CefBrowserSettings &settings, CefRefPtr< CefClient > client, bool is_devtools)
 Called before a new popup BrowserView is created. More...
 
virtual bool OnPopupBrowserViewCreated (CefRefPtr< CefBrowserView > browser_view, CefRefPtr< CefBrowserView > popup_browser_view, bool is_devtools)
 Called after |popup_browser_view| is created. More...
 
virtual ChromeToolbarType GetChromeToolbarType (CefRefPtr< CefBrowserView > browser_view)
 Returns the Chrome toolbar type that will be available via CefBrowserView::GetChromeToolbar(). More...
 
virtual bool UseFramelessWindowForPictureInPicture (CefRefPtr< CefBrowserView > browser_view)
 Return true to create frameless windows for Document picture-in-picture popups. More...
 
virtual bool OnGestureCommand (CefRefPtr< CefBrowserView > browser_view, cef_gesture_command_t gesture_command)
 Called when |browser_view| receives a gesture command. More...
 
virtual cef_runtime_style_t GetBrowserRuntimeStyle ()
 Optionally change the runtime style for this BrowserView. More...
 
- Public Member Functions inherited from CefViewDelegate
virtual CefSize GetPreferredSize (CefRefPtr< CefView > view)
 Return the preferred size for |view|. More...
 
virtual CefSize GetMinimumSize (CefRefPtr< CefView > view)
 Return the minimum size for |view|. More...
 
virtual CefSize GetMaximumSize (CefRefPtr< CefView > view)
 Return the maximum size for |view|. More...
 
virtual int GetHeightForWidth (CefRefPtr< CefView > view, int width)
 Return the height necessary to display |view| with the provided |width|. More...
 
virtual void OnParentViewChanged (CefRefPtr< CefView > view, bool added, CefRefPtr< CefView > parent)
 Called when the parent of |view| has changed. More...
 
virtual void OnChildViewChanged (CefRefPtr< CefView > view, bool added, CefRefPtr< CefView > child)
 Called when a child of |view| has changed. More...
 
virtual void OnWindowChanged (CefRefPtr< CefView > view, bool added)
 Called when |view| is added or removed from the CefWindow. More...
 
virtual void OnLayoutChanged (CefRefPtr< CefView > view, const CefRect &new_bounds)
 Called when the layout of |view| has changed. More...
 
virtual void OnFocus (CefRefPtr< CefView > view)
 Called when |view| gains focus. More...
 
virtual void OnBlur (CefRefPtr< CefView > view)
 Called when |view| loses focus. More...
 
virtual void OnThemeChanged (CefRefPtr< CefView > view)
 Called when the theme for |view| has changed, after the new theme colors have already been applied. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Implement this interface to handle BrowserView events.

The methods of this class will be called on the browser process UI thread unless otherwise indicated.

Member Typedef Documentation

◆ ChromeToolbarType

Member Function Documentation

◆ GetBrowserRuntimeStyle()

virtual cef_runtime_style_t CefBrowserViewDelegate::GetBrowserRuntimeStyle ( )
inlinevirtual

Optionally change the runtime style for this BrowserView.

See cef_runtime_style_t documentation for details.

◆ GetChromeToolbarType()

virtual ChromeToolbarType CefBrowserViewDelegate::GetChromeToolbarType ( CefRefPtr< CefBrowserView browser_view)
inlinevirtual

Returns the Chrome toolbar type that will be available via CefBrowserView::GetChromeToolbar().

See that method for related documentation.

◆ GetDelegateForPopupBrowserView()

virtual CefRefPtr<CefBrowserViewDelegate> CefBrowserViewDelegate::GetDelegateForPopupBrowserView ( CefRefPtr< CefBrowserView browser_view,
const CefBrowserSettings settings,
CefRefPtr< CefClient client,
bool  is_devtools 
)
inlinevirtual

Called before a new popup BrowserView is created.

The popup originated from |browser_view|. |settings| and |client| are the values returned from CefLifeSpanHandler::OnBeforePopup(). |is_devtools| will be true if the popup will be a DevTools browser. Return the delegate that will be used for the new popup BrowserView.

◆ OnBrowserCreated()

virtual void CefBrowserViewDelegate::OnBrowserCreated ( CefRefPtr< CefBrowserView browser_view,
CefRefPtr< CefBrowser browser 
)
inlinevirtual

Called when |browser| associated with |browser_view| is created.

This method will be called after CefLifeSpanHandler::OnAfterCreated() is called for |browser| and before OnPopupBrowserViewCreated() is called for |browser|'s parent delegate if |browser| is a popup.

◆ OnBrowserDestroyed()

virtual void CefBrowserViewDelegate::OnBrowserDestroyed ( CefRefPtr< CefBrowserView browser_view,
CefRefPtr< CefBrowser browser 
)
inlinevirtual

Called when |browser| associated with |browser_view| is destroyed.

Release all references to |browser| and do not attempt to execute any methods on |browser| after this callback returns. This method will be called before CefLifeSpanHandler::OnBeforeClose() is called for |browser|.

◆ OnGestureCommand()

virtual bool CefBrowserViewDelegate::OnGestureCommand ( CefRefPtr< CefBrowserView browser_view,
cef_gesture_command_t  gesture_command 
)
inlinevirtual

Called when |browser_view| receives a gesture command.

Return true to handle (or disable) a |gesture_command| or false to propagate the gesture to the browser for default handling. With the Chrome runtime these commands can also be handled via CefCommandHandler::OnChromeCommand.

◆ OnPopupBrowserViewCreated()

virtual bool CefBrowserViewDelegate::OnPopupBrowserViewCreated ( CefRefPtr< CefBrowserView browser_view,
CefRefPtr< CefBrowserView popup_browser_view,
bool  is_devtools 
)
inlinevirtual

Called after |popup_browser_view| is created.

This method will be called after CefLifeSpanHandler::OnAfterCreated() and OnBrowserCreated() are called for the new popup browser. The popup originated from |browser_view|. |is_devtools| will be true if the popup is a DevTools browser. Optionally add |popup_browser_view| to the views hierarchy yourself and return true. Otherwise return false and a default CefWindow will be created for the popup.

◆ UseFramelessWindowForPictureInPicture()

virtual bool CefBrowserViewDelegate::UseFramelessWindowForPictureInPicture ( CefRefPtr< CefBrowserView browser_view)
inlinevirtual

Return true to create frameless windows for Document picture-in-picture popups.

Content in frameless windows should specify draggable regions using "-webkit-app-region: drag" CSS.


The documentation for this class was generated from the following file: