| Index: 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 173202e1a59fb415b731dceb5c3131ae26ebf105..5ebfaefc91657a1b26ad6e0a1cc6ce12fe7cd28f 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -661,6 +661,10 @@ ResourceDispatcherHostImpl::CreateLoginDelegate(
|
| return delegate_->CreateLoginDelegate(auth_info, loader->request());
|
| }
|
|
|
| +bool RequestHasRecentUserGesture(const net::URLRequest* request) {
|
| + return (request->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0;
|
| +}
|
| +
|
| bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader,
|
| const GURL& url) {
|
| if (!delegate_)
|
| @@ -676,8 +680,14 @@ bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader,
|
| if (job_factory->IsHandledURL(url))
|
| return false;
|
|
|
| - return delegate_->HandleExternalProtocol(url, info->GetChildID(),
|
| - info->GetRouteID());
|
| + bool user_gesture = RequestHasRecentUserGesture(loader->request());
|
| + bool handled = delegate_->HandleExternalProtocol(url, info->GetChildID(),
|
| + info->GetRouteID(),
|
| + 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) {
|
|
|