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 119995707da204e904422217349d37c0dea528bb..089ccea684578c241dd0b397e77d5e5643864b67 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -665,6 +665,10 @@ ResourceDispatcherHostImpl::CreateLoginDelegate( |
return delegate_->CreateLoginDelegate(auth_info, loader->request()); |
} |
+bool RequestHasRecentUserGesture(const net::URLRequest* request) { |
mmenke
2014/03/31 14:38:42
This should probably just be RequestWasTriggeredBy
mmenke
2014/03/31 14:38:42
This should be in the anonymous namespace up top.
meacer
2014/03/31 18:32:30
Inlined.
|
+ return (request->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0; |
+} |
+ |
bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader, |
const GURL& url) { |
if (!delegate_) |
@@ -680,8 +684,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) { |