Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1152)

Unified Diff: chrome/browser/external_protocol/external_protocol_handler.cc

Issue 2538353002: fix external protocol handling for OOPIFs (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/external_protocol/external_protocol_handler.cc
diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc
index 2e4dcc1aaa251c9fd1a34d00cc89b0ae108ed734..0880123c3de823b12d03a51902628b39f55d330d 100644
--- a/chrome/browser/external_protocol/external_protocol_handler.cc
+++ b/chrome/browser/external_protocol/external_protocol_handler.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include <stddef.h>
-
#include <set>
#include "base/bind.h"
@@ -82,11 +81,13 @@ void LaunchUrlWithoutSecurityCheckWithDelegate(
int render_process_host_id,
int tab_contents_id,
ExternalProtocolHandler::Delegate* delegate) {
+ content::WebContents* web_contents =
+ tab_util::GetWebContentsByID(render_process_host_id, tab_contents_id);
+
if (!delegate) {
- ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(
- url, render_process_host_id, tab_contents_id);
+ ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url, web_contents);
} else {
- delegate->LaunchUrlWithoutSecurityCheck(url);
+ delegate->LaunchUrlWithoutSecurityCheck(url, web_contents);
}
}
@@ -106,7 +107,6 @@ void OnDefaultProtocolClientWorkerFinished(
if (delegate)
delegate->FinishedProcessingCheck();
-
alexmos 2016/12/01 19:21:14 No need to remove the blank line, here and in a fe
davidsac (gone - try alexmos) 2016/12/12 19:15:47 Done.
if (state == shell_integration::IS_DEFAULT) {
if (delegate)
delegate->BlockRequest();
@@ -124,7 +124,6 @@ void OnDefaultProtocolClientWorkerFinished(
has_user_gesture, delegate);
return;
}
-
LaunchUrlWithoutSecurityCheckWithDelegate(escaped_url, render_process_host_id,
tab_contents_id, delegate);
}
@@ -222,13 +221,9 @@ void ExternalProtocolHandler::LaunchUrlWithDelegate(
// static
void ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(
const GURL& url,
- int render_process_host_id,
- int tab_contents_id) {
- content::WebContents* web_contents = tab_util::GetWebContentsByID(
- render_process_host_id, tab_contents_id);
+ content::WebContents* web_contents) {
if (!web_contents)
return;
-
platform_util::OpenExternal(
Profile::FromBrowserContext(web_contents->GetBrowserContext()), url);
}

Powered by Google App Engine
This is Rietveld 408576698