chrome: Change popup default behavior with native parent (see issue #3294)

When using a Views-hosted browser window the client receives Views-related
callbacks for popups and can thereby customize the Views-hosted popup behavior.
When using an external parent window no Views-related callbacks are delivered
and customization options are restricted to providing a new parent handle via
OnBeforePopup. Consequently, we should default to a normal browser window in
the external parent case instead of the very minimial Views-hosted default.

To test (A):
1. Run `cefclient --use-default-popup --enable-chrome-runtime --use-native`
2. Select Tests > Popup Window
3. Get a normal Chrome browser window

To test (B):
1. Run `cefclient --use-default-popup [--enable-chrome-runtime] [--use-views]`
2. Select Tests > Popup Window
3. Get a native or Views-hosted browser window with title bar only
This commit is contained in:
Marshall Greenblatt
2022-04-11 17:29:53 -04:00
parent 75ca552a4e
commit a0a7a35fe2
8 changed files with 41 additions and 23 deletions

View File

@@ -288,6 +288,10 @@ class CefBrowserPlatformDelegate {
// be called on multiple threads.
virtual bool IsViewsHosted() const;
// Returns true if this delegate implements a browser with external
// (client-provided) parent window. May be called on multiple threads.
virtual bool HasExternalParent() const;
// Notify the browser that it was hidden. Only used with windowless rendering.
virtual void WasHidden(bool hidden);