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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 131783012: Fix the handling of user gestures for external protocol handler dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: joi and pkasting comments Created 6 years, 9 months 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/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index c1c3126aeb2ebea3d48ad7c647155def0966a120..bd8a351093b20983192a6d430f555f45530326ef 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -198,7 +198,8 @@ void SendExecuteMimeTypeHandlerEvent(scoped_ptr<content::StreamHandle> stream,
extension_id, web_contents, stream.Pass(), expected_content_size);
}
-void LaunchURL(const GURL& url, int render_process_id, int render_view_id) {
+void LaunchURL(const GURL& url, int render_process_id, int render_view_id,
+ bool user_gesture) {
// If there is no longer a WebContents, the request may have raced with tab
// closing. Don't fire the external request. (It may have been a prerender.)
content::WebContents* web_contents =
@@ -215,6 +216,9 @@ void LaunchURL(const GURL& url, int render_process_id, int render_view_id) {
return;
}
+ scoped_ptr<ExternalProtocolHandler::ScopedUserGesture> scoped_gesture;
+ if (user_gesture)
+ scoped_gesture.reset(new ExternalProtocolHandler::ScopedUserGesture);
mmenke 2014/03/31 14:38:42 Can't this just be put this logic in ExternalProto
meacer 2014/03/31 18:32:30 Passing the user gesture bit directly to the exter
mmenke 2014/03/31 18:38:40 Do you mean putting the scoped_gesture in External
meacer 2014/03/31 19:34:00 I meant pushing the user_gesture bit all the way d
ExternalProtocolHandler::LaunchUrlWithDelegate(
url, render_process_id, render_view_id,
g_external_protocol_handler_delegate);
@@ -441,7 +445,10 @@ ResourceDispatcherHostLoginDelegate*
}
bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
- const GURL& url, int child_id, int route_id) {
+ const GURL& url,
+ int child_id,
+ int route_id,
+ bool initiated_by_user_gesture) {
#if defined(OS_ANDROID)
// Android use a resource throttle to handle external as well as internal
// protocols.
@@ -457,7 +464,8 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&LaunchURL, url, child_id, route_id));
+ base::Bind(&LaunchURL, url, child_id, route_id,
+ initiated_by_user_gesture));
return true;
#endif
}

Powered by Google App Engine
This is Rietveld 408576698