chrome: Support usage of the Chrome toolbar from Views (see issue #2969)

This commit is contained in:
Marshall Greenblatt
2021-04-11 16:10:11 -04:00
parent 9c82785077
commit a4603c6f1a
55 changed files with 1057 additions and 156 deletions

View File

@ -80,6 +80,17 @@ class CefBrowserView : public CefView {
/*--cef()--*/
virtual CefRefPtr<CefBrowser> GetBrowser() = 0;
///
// Returns the Chrome toolbar associated with this BrowserView. Only supported
// when using the Chrome runtime. The CefBrowserViewDelegate::
// GetChromeToolbarType() method must return a value other than
// CEF_CTT_NONE and the toolbar will not be available until after this
// BrowserView is added to a CefWindow and CefViewDelegate::OnWindowChanged()
// has been called.
///
/*--cef()--*/
virtual CefRefPtr<CefView> GetChromeToolbar() = 0;
///
// Sets whether accelerators registered with CefWindow::SetAccelerator are
// triggered before or after the event is sent to the CefBrowser. If

View File

@ -52,6 +52,8 @@ class CefBrowserView;
/*--cef(source=client)--*/
class CefBrowserViewDelegate : public CefViewDelegate {
public:
typedef cef_chrome_toolbar_type_t ChromeToolbarType;
///
// Called when |browser| associated with |browser_view| is created. This
// method will be called after CefLifeSpanHandler::OnAfterCreated() is called
@ -104,6 +106,14 @@ class CefBrowserViewDelegate : public CefViewDelegate {
bool is_devtools) {
return false;
}
///
// Returns the Chrome toolbar type that will be available via
// CefBrowserView::GetChromeToolbar(). See that method for related
// documentation.
///
/*--cef(default_retval=CEF_CTT_NONE)--*/
virtual ChromeToolbarType GetChromeToolbarType() { return CEF_CTT_NONE; }
};
#endif // CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_DELEGATE_H_

View File

@ -105,6 +105,12 @@ class CefViewDelegate : public virtual CefBaseRefCounted {
bool added,
CefRefPtr<CefView> child) {}
///
// Called when |view| is added or removed from the CefWindow.
///
/*--cef(optional_param=window)--*/
virtual void OnWindowChanged(CefRefPtr<CefView> view, bool added) {}
///
// Called when |view| gains focus.
///