From 8cc3d1cce54c6f3909985761d4e8ce6cb85bd2b8 Mon Sep 17 00:00:00 2001 From: "meacer@chromium.org" Date: Thu, 3 Apr 2014 08:02:35 +0000 Subject: 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 --- content/browser/loader/resource_dispatcher_host_impl.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'content/browser/loader/resource_dispatcher_host_impl.cc') 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) { -- cgit v1.1