mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Fix callbacks for different Profile types (see issue #2969)
- Only install network intercepts for Profiles that have an associated CefBrowserContext. For incognito windows the CefBrowserContext is associated with the OffTheRecordProfileImpl's original Profile. - cefsimple: Return the default CefClient instance for browser windows created via the Chrome UI, and allow Chrome to show error pages.
This commit is contained in:
@@ -170,6 +170,13 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
|
||||
return use_proxy;
|
||||
}
|
||||
|
||||
// Don't intercept requests for Profiles that were not created by CEF.
|
||||
// For example, the User Manager profile created via
|
||||
// profiles::CreateSystemProfileForUserManager.
|
||||
auto profile = Profile::FromBrowserContext(browser_context);
|
||||
if (!CefBrowserContext::FromBrowserContext(profile->GetOriginalProfile()))
|
||||
return false;
|
||||
|
||||
auto request_handler = net_service::CreateInterceptedRequestHandler(
|
||||
browser_context, frame, render_process_id,
|
||||
type == URLLoaderFactoryType::kNavigation,
|
||||
|
@@ -260,8 +260,10 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
browser_context_ = browser_context;
|
||||
|
||||
auto profile = Profile::FromBrowserContext(browser_context);
|
||||
auto cef_browser_context =
|
||||
CefBrowserContext::FromBrowserContext(browser_context);
|
||||
CefBrowserContext::FromBrowserContext(profile->GetOriginalProfile());
|
||||
iothread_state_ = cef_browser_context->iothread_state();
|
||||
DCHECK(iothread_state_);
|
||||
cookieable_schemes_ = cef_browser_context->GetCookieableSchemes();
|
||||
|
Reference in New Issue
Block a user