mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: views: Add ability to pop out the overlay Browser (see #3790)
When running with the overlay Browser enabled (`--show-overlay-browser`), pressing Alt+O will move the overlay Browser to a new top-level Window. Pressing Alt+O again or closing the new Window via the close button will return the Browser to the overlay. Closing the Browser via `window.close()` (in the new Window or overlay) will dismiss the overlay completely as required to maintain consistent internal state. Detection of this state is supported by the new CefBrowserHost::IsReadyToBeClosed method. Draggable regions in the main Browser are updated to account for the presence or absence of the overlay Browser. Support for draggable regions in the overlay Browser in not implemented in cefclient. Behavior with multiple overlays, `window.close()` and draggable regions can be tested by adding `--hide-frame --hide-controls`.
This commit is contained in:
@@ -129,6 +129,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
std::optional<CefRect>& dip_bounds);
|
||||
void SetTitlebarHeight(const std::optional<float>& height);
|
||||
|
||||
void UpdateDraggableRegions();
|
||||
|
||||
// CefBrowserViewDelegate methods:
|
||||
CefRefPtr<CefBrowserViewDelegate> GetDelegateForPopupBrowserView(
|
||||
CefRefPtr<CefBrowserView> browser_view,
|
||||
@@ -252,7 +254,7 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
void NudgeWindow();
|
||||
|
||||
const WindowType type_;
|
||||
Delegate* delegate_; // Not owned by this object.
|
||||
Delegate* const delegate_; // Not owned by this object.
|
||||
const bool use_alloy_style_;
|
||||
bool use_alloy_style_window_;
|
||||
CefRefPtr<CefBrowserView> browser_view_;
|
||||
@@ -301,6 +303,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
bool can_go_back_ = false;
|
||||
bool can_go_forward_ = false;
|
||||
|
||||
std::vector<CefDraggableRegion> last_regions_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(ViewsWindow);
|
||||
DISALLOW_COPY_AND_ASSIGN(ViewsWindow);
|
||||
};
|
||||
|
Reference in New Issue
Block a user