mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Add support for reparenting of popups with Views (see issue #2969)
This commit is contained in:
@@ -51,8 +51,13 @@ struct CefBrowserCreateParams {
|
|||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
// The BrowserView that will own a Views-hosted browser. Will be nullptr for
|
// The BrowserView that will own a Views-hosted browser. Will be nullptr for
|
||||||
// popup browsers (the BrowserView will be created later in that case).
|
// popup browsers.
|
||||||
CefRefPtr<CefBrowserView> browser_view;
|
CefRefPtr<CefBrowserView> browser_view;
|
||||||
|
|
||||||
|
// True if this browser is a popup and has a Views-hosted opener, in which
|
||||||
|
// case the BrowserView for this browser will be created later (from
|
||||||
|
// PopupWebContentsCreated).
|
||||||
|
bool popup_with_views_hosted_opener = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Client implementation. May be nullptr.
|
// Client implementation. May be nullptr.
|
||||||
|
@@ -181,8 +181,11 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
|||||||
if (allow) {
|
if (allow) {
|
||||||
CefBrowserCreateParams create_params;
|
CefBrowserCreateParams create_params;
|
||||||
|
|
||||||
if (!browser->HasView())
|
if (browser->HasView()) {
|
||||||
|
create_params.popup_with_views_hosted_opener = true;
|
||||||
|
} else {
|
||||||
create_params.window_info = std::move(window_info);
|
create_params.window_info = std::move(window_info);
|
||||||
|
}
|
||||||
|
|
||||||
create_params.settings = pending_popup->settings;
|
create_params.settings = pending_popup->settings;
|
||||||
create_params.client = pending_popup->client;
|
create_params.client = pending_popup->client;
|
||||||
|
@@ -84,7 +84,8 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
|
|||||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
|
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
|
||||||
CreateNativeDelegate(CefWindowInfo(), background_color);
|
CreateNativeDelegate(CefWindowInfo(), background_color);
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
if (create_params.browser_view) {
|
if (create_params.browser_view ||
|
||||||
|
create_params.popup_with_views_hosted_opener) {
|
||||||
return std::make_unique<CefBrowserPlatformDelegateChromeViews>(
|
return std::make_unique<CefBrowserPlatformDelegateChromeViews>(
|
||||||
std::move(native_delegate),
|
std::move(native_delegate),
|
||||||
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
|
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "chrome/browser/profiles/profile.h"
|
#include "chrome/browser/profiles/profile.h"
|
||||||
#include "chrome/browser/ui/browser.h"
|
#include "chrome/browser/ui/browser.h"
|
||||||
|
#include "chrome/browser/ui/browser_tabstrip.h"
|
||||||
#include "content/public/browser/keyboard_event_processing_result.h"
|
#include "content/public/browser/keyboard_event_processing_result.h"
|
||||||
#include "content/public/browser/native_web_keyboard_event.h"
|
#include "content/public/browser/native_web_keyboard_event.h"
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ void ChromeBrowserDelegate::SetAsDelegate(content::WebContents* web_contents,
|
|||||||
create_params_.request_context);
|
create_params_.request_context);
|
||||||
|
|
||||||
CreateBrowser(web_contents, create_params_.settings, create_params_.client,
|
CreateBrowser(web_contents, create_params_.settings, create_params_.client,
|
||||||
std::move(platform_delegate), browser_info,
|
std::move(platform_delegate), browser_info, /*opener=*/nullptr,
|
||||||
request_context_impl);
|
request_context_impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +104,28 @@ void ChromeBrowserDelegate::WebContentsCreated(
|
|||||||
// We don't officially own |new_contents| until AddNewContents() is called.
|
// We don't officially own |new_contents| until AddNewContents() is called.
|
||||||
// However, we need to install observers/delegates here.
|
// However, we need to install observers/delegates here.
|
||||||
CreateBrowser(new_contents, settings, client, std::move(platform_delegate),
|
CreateBrowser(new_contents, settings, client, std::move(platform_delegate),
|
||||||
browser_info, request_context_impl);
|
browser_info, opener, request_context_impl);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChromeBrowserDelegate::AddNewContents(
|
||||||
|
content::WebContents* source_contents,
|
||||||
|
std::unique_ptr<content::WebContents> new_contents,
|
||||||
|
const GURL& target_url,
|
||||||
|
WindowOpenDisposition disposition,
|
||||||
|
const gfx::Rect& initial_rect,
|
||||||
|
bool user_gesture,
|
||||||
|
bool* was_blocked) {
|
||||||
|
auto new_browser =
|
||||||
|
ChromeBrowserHostImpl::GetBrowserForContents(new_contents.get());
|
||||||
|
if (new_browser) {
|
||||||
|
// Create a new Browser and give it ownership of the WebContents.
|
||||||
|
new_browser->AddNewContents(std::move(new_contents));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to default behavior from Browser::AddNewContents.
|
||||||
|
chrome::AddWebContents(browser_, source_contents, std::move(new_contents),
|
||||||
|
target_url, disposition, initial_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
|
content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
|
||||||
@@ -195,6 +217,7 @@ void ChromeBrowserDelegate::CreateBrowser(
|
|||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
||||||
scoped_refptr<CefBrowserInfo> browser_info,
|
scoped_refptr<CefBrowserInfo> browser_info,
|
||||||
|
CefRefPtr<ChromeBrowserHostImpl> opener,
|
||||||
CefRefPtr<CefRequestContextImpl> request_context_impl) {
|
CefRefPtr<CefRequestContextImpl> request_context_impl) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
DCHECK(web_contents);
|
DCHECK(web_contents);
|
||||||
@@ -202,6 +225,9 @@ void ChromeBrowserDelegate::CreateBrowser(
|
|||||||
DCHECK(browser_info);
|
DCHECK(browser_info);
|
||||||
DCHECK(request_context_impl);
|
DCHECK(request_context_impl);
|
||||||
|
|
||||||
|
// If |opener| is non-nullptr it must be a popup window.
|
||||||
|
DCHECK(!opener.get() || browser_info->is_popup());
|
||||||
|
|
||||||
if (!client) {
|
if (!client) {
|
||||||
if (auto app = CefAppManager::Get()->GetApplication()) {
|
if (auto app = CefAppManager::Get()->GetApplication()) {
|
||||||
if (auto bph = app->GetBrowserProcessHandler()) {
|
if (auto bph = app->GetBrowserProcessHandler()) {
|
||||||
@@ -226,7 +252,12 @@ void ChromeBrowserDelegate::CreateBrowser(
|
|||||||
CefRefPtr<ChromeBrowserHostImpl> browser_host =
|
CefRefPtr<ChromeBrowserHostImpl> browser_host =
|
||||||
new ChromeBrowserHostImpl(settings, client, std::move(platform_delegate),
|
new ChromeBrowserHostImpl(settings, client, std::move(platform_delegate),
|
||||||
browser_info, request_context_impl);
|
browser_info, request_context_impl);
|
||||||
browser_host->Attach(browser_, web_contents);
|
browser_host->Attach(web_contents, opener);
|
||||||
|
|
||||||
|
// The Chrome browser for a popup won't be created until AddNewContents().
|
||||||
|
if (!opener) {
|
||||||
|
browser_host->SetBrowser(browser_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CefBrowserContentsDelegate* ChromeBrowserDelegate::GetDelegateForWebContents(
|
CefBrowserContentsDelegate* ChromeBrowserDelegate::GetDelegateForWebContents(
|
||||||
|
@@ -55,6 +55,13 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
|||||||
const std::string& frame_name,
|
const std::string& frame_name,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
content::WebContents* new_contents) override;
|
content::WebContents* new_contents) override;
|
||||||
|
void AddNewContents(content::WebContents* source_contents,
|
||||||
|
std::unique_ptr<content::WebContents> new_contents,
|
||||||
|
const GURL& target_url,
|
||||||
|
WindowOpenDisposition disposition,
|
||||||
|
const gfx::Rect& initial_rect,
|
||||||
|
bool user_gesture,
|
||||||
|
bool* was_blocked) override;
|
||||||
content::WebContents* OpenURLFromTab(
|
content::WebContents* OpenURLFromTab(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::OpenURLParams& params) override;
|
const content::OpenURLParams& params) override;
|
||||||
@@ -88,6 +95,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
|||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
||||||
scoped_refptr<CefBrowserInfo> browser_info,
|
scoped_refptr<CefBrowserInfo> browser_info,
|
||||||
|
CefRefPtr<ChromeBrowserHostImpl> opener,
|
||||||
CefRefPtr<CefRequestContextImpl> request_context_impl);
|
CefRefPtr<CefRequestContextImpl> request_context_impl);
|
||||||
|
|
||||||
CefBrowserContentsDelegate* GetDelegateForWebContents(
|
CefBrowserContentsDelegate* GetDelegateForWebContents(
|
||||||
|
@@ -32,60 +32,7 @@
|
|||||||
// static
|
// static
|
||||||
CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::Create(
|
CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::Create(
|
||||||
const CefBrowserCreateParams& params) {
|
const CefBrowserCreateParams& params) {
|
||||||
// Get or create the request context and profile.
|
auto browser = CreateBrowser(params);
|
||||||
CefRefPtr<CefRequestContextImpl> request_context_impl =
|
|
||||||
CefRequestContextImpl::GetOrCreateForRequestContext(
|
|
||||||
params.request_context);
|
|
||||||
CHECK(request_context_impl);
|
|
||||||
auto cef_browser_context = request_context_impl->GetBrowserContext();
|
|
||||||
CHECK(cef_browser_context);
|
|
||||||
auto profile = cef_browser_context->AsProfile();
|
|
||||||
|
|
||||||
Browser::CreateParams chrome_params =
|
|
||||||
Browser::CreateParams(profile, /*user_gesture=*/false);
|
|
||||||
|
|
||||||
// Pass |params| to cef::BrowserDelegate::Create from the Browser constructor.
|
|
||||||
chrome_params.cef_params = base::MakeRefCounted<DelegateCreateParams>(params);
|
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
|
||||||
// Configure Browser creation to use the existing Views-based
|
|
||||||
// Widget/BrowserFrame (ChromeBrowserFrame) and BrowserView/BrowserWindow
|
|
||||||
// (ChromeBrowserView). See views/chrome_browser_frame.h for related
|
|
||||||
// documentation.
|
|
||||||
ChromeBrowserView* chrome_browser_view = nullptr;
|
|
||||||
if (params.browser_view) {
|
|
||||||
// Don't show most controls.
|
|
||||||
chrome_params.type = Browser::TYPE_POPUP;
|
|
||||||
// Don't show title bar or address.
|
|
||||||
chrome_params.trusted_source = true;
|
|
||||||
|
|
||||||
auto view_impl =
|
|
||||||
static_cast<CefBrowserViewImpl*>(params.browser_view.get());
|
|
||||||
|
|
||||||
chrome_browser_view =
|
|
||||||
static_cast<ChromeBrowserView*>(view_impl->root_view());
|
|
||||||
chrome_params.window = chrome_browser_view;
|
|
||||||
|
|
||||||
auto chrome_widget =
|
|
||||||
static_cast<ChromeBrowserFrame*>(chrome_browser_view->GetWidget());
|
|
||||||
chrome_browser_view->set_frame(chrome_widget);
|
|
||||||
}
|
|
||||||
#endif // defined(TOOLKIT_VIEWS)
|
|
||||||
|
|
||||||
// Create the Browser. This will indirectly create the ChomeBrowserDelegate.
|
|
||||||
// The same params will be used to create a new Browser if the tab is dragged
|
|
||||||
// out of the existing Browser. The returned Browser is owned by the
|
|
||||||
// associated BrowserView.
|
|
||||||
auto browser = Browser::Create(chrome_params);
|
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
|
||||||
if (chrome_browser_view) {
|
|
||||||
// Initialize the BrowserFrame and BrowserView and create the controls that
|
|
||||||
// require access to the Browser.
|
|
||||||
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
|
||||||
params.browser_view);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GURL url = params.url;
|
GURL url = params.url;
|
||||||
if (url.is_empty()) {
|
if (url.is_empty()) {
|
||||||
@@ -98,7 +45,8 @@ CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::Create(
|
|||||||
// Add a new tab. This will indirectly create a new tab WebContents and
|
// Add a new tab. This will indirectly create a new tab WebContents and
|
||||||
// call ChromeBrowserDelegate::OnWebContentsCreated to create the associated
|
// call ChromeBrowserDelegate::OnWebContentsCreated to create the associated
|
||||||
// ChromeBrowserHostImpl.
|
// ChromeBrowserHostImpl.
|
||||||
chrome::AddTabAt(browser, url, /*idx=*/-1, /*foreground=*/true);
|
chrome::AddTabAt(browser, url, /*index=*/TabStripModel::kNoTab,
|
||||||
|
/*foreground=*/true);
|
||||||
|
|
||||||
// The new tab WebContents.
|
// The new tab WebContents.
|
||||||
auto web_contents = browser->tab_strip_model()->GetActiveWebContents();
|
auto web_contents = browser->tab_strip_model()->GetActiveWebContents();
|
||||||
@@ -159,6 +107,34 @@ CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::GetBrowserForFrameRoute(
|
|||||||
|
|
||||||
ChromeBrowserHostImpl::~ChromeBrowserHostImpl() = default;
|
ChromeBrowserHostImpl::~ChromeBrowserHostImpl() = default;
|
||||||
|
|
||||||
|
void ChromeBrowserHostImpl::AddNewContents(
|
||||||
|
std::unique_ptr<content::WebContents> contents) {
|
||||||
|
DCHECK(contents);
|
||||||
|
DCHECK(!browser_);
|
||||||
|
|
||||||
|
// We should already be associated with the WebContents.
|
||||||
|
DCHECK_EQ(GetWebContents(), contents.get());
|
||||||
|
|
||||||
|
CefBrowserCreateParams params;
|
||||||
|
params.request_context = request_context();
|
||||||
|
#if defined(TOOLKIT_VIEWS)
|
||||||
|
params.browser_view = GetBrowserView();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Create the new Browser representation.
|
||||||
|
auto browser = CreateBrowser(params);
|
||||||
|
|
||||||
|
// Add the WebContents to the Browser.
|
||||||
|
browser->tab_strip_model()->AddWebContents(
|
||||||
|
std::move(contents), /*index=*/TabStripModel::kNoTab,
|
||||||
|
ui::PageTransition::PAGE_TRANSITION_AUTO_TOPLEVEL,
|
||||||
|
TabStripModel::ADD_ACTIVE);
|
||||||
|
|
||||||
|
SetBrowser(browser);
|
||||||
|
|
||||||
|
browser->window()->Show();
|
||||||
|
}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::OnWebContentsDestroyed(
|
void ChromeBrowserHostImpl::OnWebContentsDestroyed(
|
||||||
content::WebContents* web_contents) {
|
content::WebContents* web_contents) {
|
||||||
platform_delegate_->WebContentsDestroyed(web_contents);
|
platform_delegate_->WebContentsDestroyed(web_contents);
|
||||||
@@ -461,17 +437,112 @@ ChromeBrowserHostImpl::ChromeBrowserHostImpl(
|
|||||||
browser_info,
|
browser_info,
|
||||||
request_context) {}
|
request_context) {}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::Attach(Browser* browser,
|
// static
|
||||||
content::WebContents* web_contents) {
|
Browser* ChromeBrowserHostImpl::CreateBrowser(
|
||||||
DCHECK(browser);
|
const CefBrowserCreateParams& params) {
|
||||||
|
// Get or create the request context and profile.
|
||||||
|
CefRefPtr<CefRequestContextImpl> request_context_impl =
|
||||||
|
CefRequestContextImpl::GetOrCreateForRequestContext(
|
||||||
|
params.request_context);
|
||||||
|
CHECK(request_context_impl);
|
||||||
|
auto cef_browser_context = request_context_impl->GetBrowserContext();
|
||||||
|
CHECK(cef_browser_context);
|
||||||
|
auto profile = cef_browser_context->AsProfile();
|
||||||
|
|
||||||
|
Browser::CreateParams chrome_params =
|
||||||
|
Browser::CreateParams(profile, /*user_gesture=*/false);
|
||||||
|
|
||||||
|
// Pass |params| to cef::BrowserDelegate::Create from the Browser constructor.
|
||||||
|
chrome_params.cef_params = base::MakeRefCounted<DelegateCreateParams>(params);
|
||||||
|
|
||||||
|
#if defined(TOOLKIT_VIEWS)
|
||||||
|
// Configure Browser creation to use the existing Views-based
|
||||||
|
// Widget/BrowserFrame (ChromeBrowserFrame) and BrowserView/BrowserWindow
|
||||||
|
// (ChromeBrowserView). See views/chrome_browser_frame.h for related
|
||||||
|
// documentation.
|
||||||
|
ChromeBrowserView* chrome_browser_view = nullptr;
|
||||||
|
if (params.browser_view) {
|
||||||
|
// Don't show most controls.
|
||||||
|
chrome_params.type = Browser::TYPE_POPUP;
|
||||||
|
// Don't show title bar or address.
|
||||||
|
chrome_params.trusted_source = true;
|
||||||
|
|
||||||
|
auto view_impl =
|
||||||
|
static_cast<CefBrowserViewImpl*>(params.browser_view.get());
|
||||||
|
|
||||||
|
chrome_browser_view =
|
||||||
|
static_cast<ChromeBrowserView*>(view_impl->root_view());
|
||||||
|
chrome_params.window = chrome_browser_view;
|
||||||
|
|
||||||
|
auto chrome_widget =
|
||||||
|
static_cast<ChromeBrowserFrame*>(chrome_browser_view->GetWidget());
|
||||||
|
chrome_browser_view->set_frame(chrome_widget);
|
||||||
|
}
|
||||||
|
#endif // defined(TOOLKIT_VIEWS)
|
||||||
|
|
||||||
|
// Create the Browser. This will indirectly create the ChomeBrowserDelegate.
|
||||||
|
// The same params will be used to create a new Browser if the tab is dragged
|
||||||
|
// out of the existing Browser. The returned Browser is owned by the
|
||||||
|
// associated BrowserView.
|
||||||
|
auto browser = Browser::Create(chrome_params);
|
||||||
|
|
||||||
|
#if defined(TOOLKIT_VIEWS)
|
||||||
|
if (chrome_browser_view) {
|
||||||
|
// Initialize the BrowserFrame and BrowserView and create the controls that
|
||||||
|
// require access to the Browser.
|
||||||
|
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
||||||
|
params.browser_view);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return browser;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChromeBrowserHostImpl::Attach(content::WebContents* web_contents,
|
||||||
|
CefRefPtr<ChromeBrowserHostImpl> opener) {
|
||||||
DCHECK(web_contents);
|
DCHECK(web_contents);
|
||||||
|
|
||||||
SetBrowser(browser);
|
if (opener) {
|
||||||
|
// Give the opener browser's platform delegate an opportunity to modify the
|
||||||
|
// new browser's platform delegate.
|
||||||
|
opener->platform_delegate_->PopupWebContentsCreated(
|
||||||
|
settings_, client_, web_contents, platform_delegate_.get(),
|
||||||
|
/*is_devtools_popup=*/false);
|
||||||
|
}
|
||||||
|
|
||||||
platform_delegate_->WebContentsCreated(web_contents,
|
platform_delegate_->WebContentsCreated(web_contents,
|
||||||
/*own_web_contents=*/false);
|
/*own_web_contents=*/false);
|
||||||
contents_delegate_->ObserveWebContents(web_contents);
|
contents_delegate_->ObserveWebContents(web_contents);
|
||||||
|
|
||||||
|
// Associate the platform delegate with this browser.
|
||||||
|
platform_delegate_->BrowserCreated(this);
|
||||||
|
|
||||||
|
// Associate the base class with the WebContents.
|
||||||
InitializeBrowser();
|
InitializeBrowser();
|
||||||
|
|
||||||
|
// Notify that the browser has been created. These must be delivered in the
|
||||||
|
// expected order.
|
||||||
|
|
||||||
|
// 1. Notify the browser's LifeSpanHandler. This must always be the first
|
||||||
|
// notification for the browser.
|
||||||
|
{
|
||||||
|
// The WebContents won't be added to the Browser's TabStripModel until later
|
||||||
|
// in the current call stack. Block navigation until that time.
|
||||||
|
auto navigation_lock = browser_info_->CreateNavigationLock();
|
||||||
|
OnAfterCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Notify the platform delegate. With Views this will result in a call to
|
||||||
|
// CefBrowserViewDelegate::OnBrowserCreated().
|
||||||
|
platform_delegate_->NotifyBrowserCreated();
|
||||||
|
|
||||||
|
if (opener && opener->platform_delegate_) {
|
||||||
|
// 3. Notify the opener browser's platform delegate. With Views this will
|
||||||
|
// result in a call to CefBrowserViewDelegate::OnPopupBrowserViewCreated().
|
||||||
|
opener->platform_delegate_->PopupBrowserCreated(
|
||||||
|
this,
|
||||||
|
/*is_devtools_popup=*/false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::SetBrowser(Browser* browser) {
|
void ChromeBrowserHostImpl::SetBrowser(Browser* browser) {
|
||||||
@@ -481,21 +552,6 @@ void ChromeBrowserHostImpl::SetBrowser(Browser* browser) {
|
|||||||
->set_chrome_browser(browser);
|
->set_chrome_browser(browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::InitializeBrowser() {
|
|
||||||
CEF_REQUIRE_UIT();
|
|
||||||
DCHECK(browser_);
|
|
||||||
|
|
||||||
// Associate the platform delegate with this browser.
|
|
||||||
platform_delegate_->BrowserCreated(this);
|
|
||||||
|
|
||||||
CefBrowserHostBase::InitializeBrowser();
|
|
||||||
|
|
||||||
// The WebContents won't be added to the Browser's TabStripModel until later
|
|
||||||
// in the current call stack. Block navigation until that time.
|
|
||||||
auto navigation_lock = browser_info_->CreateNavigationLock();
|
|
||||||
OnAfterCreated();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::WindowDestroyed() {
|
void ChromeBrowserHostImpl::WindowDestroyed() {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
|
@@ -142,17 +142,24 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
|
|||||||
scoped_refptr<CefBrowserInfo> browser_info,
|
scoped_refptr<CefBrowserInfo> browser_info,
|
||||||
CefRefPtr<CefRequestContextImpl> request_context);
|
CefRefPtr<CefRequestContextImpl> request_context);
|
||||||
|
|
||||||
// Called from ChromeBrowserDelegate::SetAsDelegate when this object is first
|
// Create a new Browser without initializing the WebContents.
|
||||||
// created. Must be called on the UI thread.
|
static Browser* CreateBrowser(const CefBrowserCreateParams& params);
|
||||||
void Attach(Browser* browser, content::WebContents* web_contents);
|
|
||||||
|
|
||||||
// Called from ChromeBrowserDelegate::SetAsDelegate when this object changes
|
// Called from ChromeBrowserDelegate::CreateBrowser when this object is first
|
||||||
// Browser ownership (e.g. dragging between windows). The old Browser will be
|
// created. Must be called on the UI thread.
|
||||||
// cleared before the new Browser is added. Must be called on the UI thread.
|
void Attach(content::WebContents* web_contents,
|
||||||
|
CefRefPtr<ChromeBrowserHostImpl> opener);
|
||||||
|
|
||||||
|
// Called from ChromeBrowserDelegate::AddNewContents to take ownership of a
|
||||||
|
// popup WebContents.
|
||||||
|
void AddNewContents(std::unique_ptr<content::WebContents> contents);
|
||||||
|
|
||||||
|
// Called when this object changes Browser ownership (e.g. initially created,
|
||||||
|
// dragging between windows, etc). The old Browser, if any, will be cleared
|
||||||
|
// before the new Browser is added. Must be called on the UI thread.
|
||||||
void SetBrowser(Browser* browser);
|
void SetBrowser(Browser* browser);
|
||||||
|
|
||||||
// CefBrowserHostBase methods:
|
// CefBrowserHostBase methods:
|
||||||
void InitializeBrowser() override;
|
|
||||||
void WindowDestroyed() override;
|
void WindowDestroyed() override;
|
||||||
void DestroyBrowser() override;
|
void DestroyBrowser() override;
|
||||||
|
|
||||||
|
@@ -4,14 +4,59 @@
|
|||||||
|
|
||||||
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
|
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
|
||||||
|
|
||||||
|
#include "include/views/cef_window.h"
|
||||||
|
|
||||||
#include "chrome/browser/ui/browser.h"
|
#include "chrome/browser/ui/browser.h"
|
||||||
#include "ui/views/widget/widget.h"
|
#include "ui/views/widget/widget.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// Default popup window delegate implementation.
|
||||||
|
class PopupWindowDelegate : public CefWindowDelegate {
|
||||||
|
public:
|
||||||
|
explicit PopupWindowDelegate(CefRefPtr<CefBrowserView> browser_view)
|
||||||
|
: browser_view_(browser_view) {}
|
||||||
|
|
||||||
|
void OnWindowCreated(CefRefPtr<CefWindow> window) override {
|
||||||
|
window->AddChildView(browser_view_);
|
||||||
|
window->Show();
|
||||||
|
browser_view_->RequestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnWindowDestroyed(CefRefPtr<CefWindow> window) override {
|
||||||
|
browser_view_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CanClose(CefRefPtr<CefWindow> window) override {
|
||||||
|
CefRefPtr<CefBrowser> browser = browser_view_->GetBrowser();
|
||||||
|
if (browser)
|
||||||
|
return browser->GetHost()->TryCloseBrowser();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
CefRefPtr<CefBrowserView> browser_view_;
|
||||||
|
|
||||||
|
IMPLEMENT_REFCOUNTING(PopupWindowDelegate);
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(PopupWindowDelegate);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
CefBrowserPlatformDelegateChromeViews::CefBrowserPlatformDelegateChromeViews(
|
CefBrowserPlatformDelegateChromeViews::CefBrowserPlatformDelegateChromeViews(
|
||||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
|
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
|
||||||
CefRefPtr<CefBrowserViewImpl> browser_view)
|
CefRefPtr<CefBrowserViewImpl> browser_view)
|
||||||
: CefBrowserPlatformDelegateChrome(std::move(native_delegate)),
|
: CefBrowserPlatformDelegateChrome(std::move(native_delegate)) {
|
||||||
browser_view_(browser_view) {}
|
if (browser_view)
|
||||||
|
SetBrowserView(browser_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefBrowserPlatformDelegateChromeViews::SetBrowserView(
|
||||||
|
CefRefPtr<CefBrowserViewImpl> browser_view) {
|
||||||
|
DCHECK(!browser_view_);
|
||||||
|
DCHECK(browser_view);
|
||||||
|
browser_view_ = browser_view;
|
||||||
|
}
|
||||||
|
|
||||||
void CefBrowserPlatformDelegateChromeViews::WebContentsCreated(
|
void CefBrowserPlatformDelegateChromeViews::WebContentsCreated(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
@@ -59,6 +104,50 @@ CefBrowserPlatformDelegateChromeViews::GetBrowserView() const {
|
|||||||
return browser_view_.get();
|
return browser_view_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefBrowserPlatformDelegateChromeViews::PopupWebContentsCreated(
|
||||||
|
const CefBrowserSettings& settings,
|
||||||
|
CefRefPtr<CefClient> client,
|
||||||
|
content::WebContents* new_web_contents,
|
||||||
|
CefBrowserPlatformDelegate* new_platform_delegate,
|
||||||
|
bool is_devtools) {
|
||||||
|
DCHECK(new_platform_delegate->IsViewsHosted());
|
||||||
|
auto* new_platform_delegate_impl =
|
||||||
|
static_cast<CefBrowserPlatformDelegateChromeViews*>(
|
||||||
|
new_platform_delegate);
|
||||||
|
|
||||||
|
CefRefPtr<CefBrowserViewDelegate> new_delegate;
|
||||||
|
if (browser_view_->delegate()) {
|
||||||
|
new_delegate = browser_view_->delegate()->GetDelegateForPopupBrowserView(
|
||||||
|
browser_view_.get(), settings, client, is_devtools);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new BrowserView for the popup.
|
||||||
|
CefRefPtr<CefBrowserViewImpl> new_browser_view =
|
||||||
|
CefBrowserViewImpl::CreateForPopup(settings, new_delegate);
|
||||||
|
|
||||||
|
// Associate the PlatformDelegate with the new BrowserView.
|
||||||
|
new_platform_delegate_impl->SetBrowserView(new_browser_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefBrowserPlatformDelegateChromeViews::PopupBrowserCreated(
|
||||||
|
CefBrowserHostBase* new_browser,
|
||||||
|
bool is_devtools) {
|
||||||
|
CefRefPtr<CefBrowserView> new_browser_view =
|
||||||
|
CefBrowserView::GetForBrowser(new_browser);
|
||||||
|
DCHECK(new_browser_view);
|
||||||
|
|
||||||
|
bool popup_handled = false;
|
||||||
|
if (browser_view_->delegate()) {
|
||||||
|
popup_handled = browser_view_->delegate()->OnPopupBrowserViewCreated(
|
||||||
|
browser_view_.get(), new_browser_view.get(), is_devtools);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!popup_handled) {
|
||||||
|
CefWindow::CreateTopLevelWindow(
|
||||||
|
new PopupWindowDelegate(new_browser_view.get()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CefBrowserPlatformDelegateChromeViews::IsViewsHosted() const {
|
bool CefBrowserPlatformDelegateChromeViews::IsViewsHosted() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -26,9 +26,19 @@ class CefBrowserPlatformDelegateChromeViews
|
|||||||
void CloseHostWindow() override;
|
void CloseHostWindow() override;
|
||||||
views::Widget* GetWindowWidget() const override;
|
views::Widget* GetWindowWidget() const override;
|
||||||
CefRefPtr<CefBrowserView> GetBrowserView() const override;
|
CefRefPtr<CefBrowserView> GetBrowserView() const override;
|
||||||
|
void PopupWebContentsCreated(
|
||||||
|
const CefBrowserSettings& settings,
|
||||||
|
CefRefPtr<CefClient> client,
|
||||||
|
content::WebContents* new_web_contents,
|
||||||
|
CefBrowserPlatformDelegate* new_platform_delegate,
|
||||||
|
bool is_devtools) override;
|
||||||
|
void PopupBrowserCreated(CefBrowserHostBase* new_browser,
|
||||||
|
bool is_devtools) override;
|
||||||
bool IsViewsHosted() const override;
|
bool IsViewsHosted() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void SetBrowserView(CefRefPtr<CefBrowserViewImpl> browser_view);
|
||||||
|
|
||||||
CefRefPtr<CefBrowserViewImpl> browser_view_;
|
CefRefPtr<CefBrowserViewImpl> browser_view_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -10,8 +10,6 @@
|
|||||||
#include "libcef/browser/context.h"
|
#include "libcef/browser/context.h"
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
#include "libcef/browser/views/window_impl.h"
|
#include "libcef/browser/views/window_impl.h"
|
||||||
#include "libcef/features/runtime.h"
|
|
||||||
#include "libcef/features/runtime_checks.h"
|
|
||||||
|
|
||||||
#include "content/public/browser/native_web_keyboard_event.h"
|
#include "content/public/browser/native_web_keyboard_event.h"
|
||||||
#include "ui/content_accelerators/accelerator_util.h"
|
#include "ui/content_accelerators/accelerator_util.h"
|
||||||
@@ -62,7 +60,6 @@ CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::Create(
|
|||||||
CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::CreateForPopup(
|
CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::CreateForPopup(
|
||||||
const CefBrowserSettings& settings,
|
const CefBrowserSettings& settings,
|
||||||
CefRefPtr<CefBrowserViewDelegate> delegate) {
|
CefRefPtr<CefBrowserViewDelegate> delegate) {
|
||||||
REQUIRE_ALLOY_RUNTIME();
|
|
||||||
CEF_REQUIRE_UIT_RETURN(nullptr);
|
CEF_REQUIRE_UIT_RETURN(nullptr);
|
||||||
|
|
||||||
CefRefPtr<CefBrowserViewImpl> browser_view = new CefBrowserViewImpl(delegate);
|
CefRefPtr<CefBrowserViewImpl> browser_view = new CefBrowserViewImpl(delegate);
|
||||||
|
@@ -13,7 +13,7 @@ index ba0c5c3fc044..b4df9af95ecd 100644
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
||||||
index 2f2862c42612..b90c7363412b 100644
|
index 2f2862c42612..f11579501774 100644
|
||||||
--- chrome/browser/ui/browser.cc
|
--- chrome/browser/ui/browser.cc
|
||||||
+++ chrome/browser/ui/browser.cc
|
+++ chrome/browser/ui/browser.cc
|
||||||
@@ -256,6 +256,20 @@
|
@@ -256,6 +256,20 @@
|
||||||
@@ -102,7 +102,23 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
NavigateParams nav_params(this, params.url, params.transition);
|
NavigateParams nav_params(this, params.url, params.transition);
|
||||||
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
||||||
nav_params.source_contents = source;
|
nav_params.source_contents = source;
|
||||||
@@ -1652,6 +1699,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
@@ -1634,6 +1681,15 @@ void Browser::AddNewContents(WebContents* source,
|
||||||
|
source, disposition);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if BUILDFLAG(ENABLE_CEF)
|
||||||
|
+ if (cef_browser_delegate_) {
|
||||||
|
+ cef_browser_delegate_->AddNewContents(
|
||||||
|
+ source, std::move(new_contents), target_url, disposition, initial_rect,
|
||||||
|
+ user_gesture, was_blocked);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
chrome::AddWebContents(this, source, std::move(new_contents), target_url,
|
||||||
|
disposition, initial_rect);
|
||||||
|
}
|
||||||
|
@@ -1652,6 +1708,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||||
bool to_different_document) {
|
bool to_different_document) {
|
||||||
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
||||||
UpdateWindowForLoadingStateChanged(source, to_different_document);
|
UpdateWindowForLoadingStateChanged(source, to_different_document);
|
||||||
@@ -111,7 +127,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Browser::CloseContents(WebContents* source) {
|
void Browser::CloseContents(WebContents* source) {
|
||||||
@@ -1679,6 +1728,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
@@ -1679,6 +1737,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||||
@@ -120,7 +136,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
if (!GetStatusBubble())
|
if (!GetStatusBubble())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1686,6 +1737,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
@@ -1686,6 +1746,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||||
GetStatusBubble()->SetURL(url);
|
GetStatusBubble()->SetURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +154,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
void Browser::ContentsMouseEvent(WebContents* source,
|
void Browser::ContentsMouseEvent(WebContents* source,
|
||||||
bool motion,
|
bool motion,
|
||||||
bool exited) {
|
bool exited) {
|
||||||
@@ -1802,6 +1864,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
@@ -1802,6 +1873,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||||
|
|
||||||
// Make the tab show up in the task manager.
|
// Make the tab show up in the task manager.
|
||||||
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
||||||
@@ -149,7 +165,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
|
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
|
||||||
@@ -1838,6 +1904,8 @@ void Browser::RendererResponsive(
|
@@ -1838,6 +1913,8 @@ void Browser::RendererResponsive(
|
||||||
void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) {
|
void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) {
|
||||||
if (web_contents == tab_strip_model_->GetActiveWebContents())
|
if (web_contents == tab_strip_model_->GetActiveWebContents())
|
||||||
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
|
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
|
||||||
@@ -158,7 +174,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
|
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
|
||||||
@@ -1884,11 +1952,15 @@ void Browser::EnterFullscreenModeForTab(
|
@@ -1884,11 +1961,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||||
const blink::mojom::FullscreenOptions& options) {
|
const blink::mojom::FullscreenOptions& options) {
|
||||||
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
||||||
requesting_frame, options.display_id);
|
requesting_frame, options.display_id);
|
||||||
@@ -174,7 +190,7 @@ index 2f2862c42612..b90c7363412b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
||||||
@@ -2731,6 +2803,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
@@ -2731,6 +2812,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||||
content_translate_driver->RemoveTranslationObserver(this);
|
content_translate_driver->RemoveTranslationObserver(this);
|
||||||
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
||||||
}
|
}
|
||||||
|
@@ -13,11 +13,6 @@ void CreateBrowserDelegates(ClientAppBrowser::DelegateSet& delegates) {
|
|||||||
extern void CreateAudioOutputTests(ClientAppBrowser::DelegateSet & delegates);
|
extern void CreateAudioOutputTests(ClientAppBrowser::DelegateSet & delegates);
|
||||||
CreateAudioOutputTests(delegates);
|
CreateAudioOutputTests(delegates);
|
||||||
|
|
||||||
// Bring in navigation tests.
|
|
||||||
extern void CreateNavigationBrowserTests(ClientAppBrowser::DelegateSet &
|
|
||||||
delegates);
|
|
||||||
CreateNavigationBrowserTests(delegates);
|
|
||||||
|
|
||||||
// Bring in the plugin tests.
|
// Bring in the plugin tests.
|
||||||
extern void CreatePluginBrowserTests(ClientAppBrowser::DelegateSet &
|
extern void CreatePluginBrowserTests(ClientAppBrowser::DelegateSet &
|
||||||
delegates);
|
delegates);
|
||||||
|
@@ -20,22 +20,6 @@ using client::ClientAppRenderer;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Browser-side app delegate.
|
|
||||||
class NavigationBrowserTest : public client::ClientAppBrowser::Delegate {
|
|
||||||
public:
|
|
||||||
NavigationBrowserTest() {}
|
|
||||||
|
|
||||||
void OnBeforeCommandLineProcessing(
|
|
||||||
CefRefPtr<client::ClientAppBrowser> app,
|
|
||||||
CefRefPtr<CefCommandLine> command_line) override {
|
|
||||||
// Disable popup blocking for the chrome runtime.
|
|
||||||
command_line->AppendSwitch("disable-popup-blocking");
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
IMPLEMENT_REFCOUNTING(NavigationBrowserTest);
|
|
||||||
};
|
|
||||||
|
|
||||||
const char kHNav1[] = "http://tests-hnav.com/nav1.html";
|
const char kHNav1[] = "http://tests-hnav.com/nav1.html";
|
||||||
const char kHNav2[] = "http://tests-hnav.com/nav2.html";
|
const char kHNav2[] = "http://tests-hnav.com/nav2.html";
|
||||||
const char kHNav3[] = "http://tests-hnav.com/nav3.html";
|
const char kHNav3[] = "http://tests-hnav.com/nav3.html";
|
||||||
@@ -3548,10 +3532,3 @@ void CreateNavigationRendererTests(ClientAppRenderer::DelegateSet& delegates) {
|
|||||||
delegates.insert(new LoadNavRendererTest);
|
delegates.insert(new LoadNavRendererTest);
|
||||||
delegates.insert(new ExtraInfoNavRendererTest);
|
delegates.insert(new ExtraInfoNavRendererTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Entry point for creating plugin browser test objects.
|
|
||||||
// Called from client_app_delegates.cc.
|
|
||||||
void CreateNavigationBrowserTests(
|
|
||||||
client::ClientAppBrowser::DelegateSet& delegates) {
|
|
||||||
delegates.insert(new NavigationBrowserTest);
|
|
||||||
}
|
|
||||||
|
@@ -47,6 +47,9 @@ void ClientAppBrowser::OnBeforeCommandLineProcessing(
|
|||||||
command_line->AppendSwitch("disable-gpu-shader-disk-cache");
|
command_line->AppendSwitch("disable-gpu-shader-disk-cache");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable popup blocking for the chrome runtime.
|
||||||
|
command_line->AppendSwitch("disable-popup-blocking");
|
||||||
|
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
// Disable the toolchain prompt on macOS.
|
// Disable the toolchain prompt on macOS.
|
||||||
command_line->AppendSwitch("use-mock-keychain");
|
command_line->AppendSwitch("use-mock-keychain");
|
||||||
|
Reference in New Issue
Block a user