summaryrefslogtreecommitdiffstats
path: root/content/browser/loader
diff options
context:
space:
mode:
authormeacer@chromium.org <meacer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 08:02:35 +0000
committermeacer@chromium.org <meacer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 08:02:35 +0000
commit8cc3d1cce54c6f3909985761d4e8ce6cb85bd2b8 (patch)
treecf04f3242bacb9f7f92d5aa9bd6c6068ba2a1447 /content/browser/loader
parent3ce3bf289232be6e15991e6458d25087a4583236 (diff)
downloadchromium_src-8cc3d1cce54c6f3909985761d4e8ce6cb85bd2b8.zip
chromium_src-8cc3d1cce54c6f3909985761d4e8ce6cb85bd2b8.tar.gz
chromium_src-8cc3d1cce54c6f3909985761d4e8ce6cb85bd2b8.tar.bz2
Relanding user gesture fix for external protocol handlers after revert.
The original CL that broke the build: https://codereview.chromium.org/131783012/ BUG=173557 TBR=pkasting@chromium.org,joi@chromium.org,kalman@chromium.org,jochen@chromium.org,mmenke@chromium.org,boliu@chromium.org Review URL: https://codereview.chromium.org/214603010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader')
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 61fc35b..c5e067d 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -679,8 +679,15 @@ bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader,
if (job_factory->IsHandledURL(url))
return false;
- return delegate_->HandleExternalProtocol(url, info->GetChildID(),
- info->GetRouteID());
+ bool initiated_by_user_gesture =
+ (loader->request()->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0;
+ bool handled = delegate_->HandleExternalProtocol(url, info->GetChildID(),
+ info->GetRouteID(),
+ initiated_by_user_gesture);
+ // Consume the user gesture if the external protocol dialog is shown.
+ if (handled)
+ last_user_gesture_time_ = base::TimeTicks();
+ return handled;
}
void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) {