mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
This change adds a `--use-default-popup` command-line option to cefclient. When specified, popup windows will be created with default styling (e.g. without an application-provided native parent window). This change also adds some reasonable default window bounds in cases where they are not specified by the client.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
#include "tests/cefclient/browser/client_handler_std.h"
|
||||
#include "tests/cefclient/browser/main_context.h"
|
||||
#include "tests/cefclient/browser/test_runner.h"
|
||||
#include "tests/shared/browser/extension_util.h"
|
||||
@@ -130,13 +131,21 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsPopup(
|
||||
CefBrowserSettings& settings) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
MainContext::Get()->PopulateBrowserSettings(&settings);
|
||||
|
||||
if (MainContext::Get()->UseDefaultPopup()) {
|
||||
// Use default window creation for the popup. A new |client| instance is
|
||||
// still required by cefclient architecture.
|
||||
client = new ClientHandlerStd(/*delegate=*/nullptr, with_controls,
|
||||
/*startup_url=*/CefString());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!temp_window_) {
|
||||
// TempWindow must be created on the UI thread.
|
||||
temp_window_.reset(new TempWindow());
|
||||
}
|
||||
|
||||
MainContext::Get()->PopulateBrowserSettings(&settings);
|
||||
|
||||
scoped_refptr<RootWindow> root_window =
|
||||
RootWindow::Create(MainContext::Get()->UseViews());
|
||||
root_window->InitAsPopup(this, with_controls, with_osr, popupFeatures,
|
||||
|
Reference in New Issue
Block a user