| Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| index 34440ad5ba0ec50c16b4d878bdeb54341742d9c8..5e247c8a3ab5872b92c242c874f055829d1127e6 100644
|
| --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| @@ -220,7 +220,6 @@ void SendExecuteMimeTypeHandlerEvent(
|
|
|
| void LaunchURL(
|
| const GURL& url,
|
| - int render_process_id,
|
| const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
|
| ui::PageTransition page_transition,
|
| bool has_user_gesture,
|
| @@ -243,15 +242,11 @@ void LaunchURL(
|
| // If the URL is in whitelist, we launch it without asking the user and
|
| // without any additional security checks. Since the URL is whitelisted,
|
| // we assume it can be executed.
|
| - // TODO(davidsac): External protocol handling needs to be
|
| - // fixed for OOPIFs. See https://crbug.com/668289.
|
| if (is_whitelisted) {
|
| - ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(
|
| - url, render_process_id,
|
| - web_contents->GetRenderViewHost()->GetRoutingID());
|
| + ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url, web_contents);
|
| } else {
|
| ExternalProtocolHandler::LaunchUrlWithDelegate(
|
| - url, render_process_id,
|
| + url, web_contents->GetRenderViewHost()->GetProcess()->GetID(),
|
| web_contents->GetRenderViewHost()->GetRoutingID(), page_transition,
|
| has_user_gesture, g_external_protocol_handler_delegate);
|
| }
|
| @@ -569,11 +564,12 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
|
| // content page.
|
| return false;
|
| }
|
| - int child_id = info->GetChildID();
|
| +
|
| #if BUILDFLAG(ENABLE_EXTENSIONS)
|
| // External protocols are disabled for guests. An exception is made for the
|
| // "mailto" protocol, so that pages that utilize it work properly in a
|
| // WebView.
|
| + int child_id = info->GetChildID();
|
| ChromeNavigationUIData* navigation_data =
|
| static_cast<ChromeNavigationUIData*>(info->GetNavigationUIData());
|
| if ((extensions::WebViewRendererState::GetInstance()->IsGuest(child_id) ||
|
| @@ -595,8 +591,7 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
|
| url_state == policy::URLBlacklist::URLBlacklistState::URL_IN_WHITELIST;
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&LaunchURL, url, child_id,
|
| - info->GetWebContentsGetterForRequest(),
|
| + base::Bind(&LaunchURL, url, info->GetWebContentsGetterForRequest(),
|
| info->GetPageTransition(), info->HasUserGesture(),
|
| is_whitelisted));
|
| return true;
|
|
|