summaryrefslogtreecommitdiffstats
path: root/content/browser/loader/resource_dispatcher_host_impl.cc
diff options
context:
space:
mode:
authormeacer@chromium.org <meacer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-02 00:55:19 +0000
committermeacer@chromium.org <meacer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-02 00:55:19 +0000
commitc4b6c85962e5c1dca60c2fc08c75abd52dbd6f01 (patch)
treee6912608ee6e6beb8d53138d33131915c179c9f5 /content/browser/loader/resource_dispatcher_host_impl.cc
parent94ec440e77ad0b84608869d98b4ec92e7834ced1 (diff)
downloadchromium_src-c4b6c85962e5c1dca60c2fc08c75abd52dbd6f01.zip
chromium_src-c4b6c85962e5c1dca60c2fc08c75abd52dbd6f01.tar.gz
chromium_src-c4b6c85962e5c1dca60c2fc08c75abd52dbd6f01.tar.bz2
Fix the handling of user gestures for external protocol handler dialogs.
- Remove browser state from external protocol handler. - Use gesture with a timeout. BUG=173557 Review URL: https://codereview.chromium.org/131783012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader/resource_dispatcher_host_impl.cc')
-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) {