Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 426713002: Revert of Fix the handling of user gestures for external protocol handler dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/resource_dispatcher_host_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); 678 ResourceRequestInfoImpl* info = loader->GetRequestInfo();
679 679
680 if (!ResourceType::IsFrame(info->GetResourceType())) 680 if (!ResourceType::IsFrame(info->GetResourceType()))
681 return false; 681 return false;
682 682
683 const net::URLRequestJobFactory* job_factory = 683 const net::URLRequestJobFactory* job_factory =
684 info->GetContext()->GetRequestContext()->job_factory(); 684 info->GetContext()->GetRequestContext()->job_factory();
685 if (job_factory->IsHandledURL(url)) 685 if (job_factory->IsHandledURL(url))
686 return false; 686 return false;
687 687
688 bool initiated_by_user_gesture = 688 return delegate_->HandleExternalProtocol(
689 (loader->request()->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0; 689 url, info->GetChildID(), info->GetRouteID());
690 bool handled = delegate_->HandleExternalProtocol(url, info->GetChildID(),
691 info->GetRouteID(),
692 initiated_by_user_gesture);
693 // Consume the user gesture if the external protocol dialog is shown.
694 if (handled)
695 last_user_gesture_time_ = base::TimeTicks();
696 return handled;
697 } 690 }
698 691
699 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { 692 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) {
700 // Make sure we have the load state monitor running 693 // Make sure we have the load state monitor running
701 if (!update_load_states_timer_->IsRunning()) { 694 if (!update_load_states_timer_->IsRunning()) {
702 update_load_states_timer_->Start(FROM_HERE, 695 update_load_states_timer_->Start(FROM_HERE,
703 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec), 696 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec),
704 this, &ResourceDispatcherHostImpl::UpdateLoadStates); 697 this, &ResourceDispatcherHostImpl::UpdateLoadStates);
705 } 698 }
706 } 699 }
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 1988
1996 // Add a flag to selectively bypass the data reduction proxy if the resource 1989 // Add a flag to selectively bypass the data reduction proxy if the resource
1997 // type is not an image. 1990 // type is not an image.
1998 if (request_data.resource_type != ResourceType::IMAGE) 1991 if (request_data.resource_type != ResourceType::IMAGE)
1999 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 1992 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2000 1993
2001 return load_flags; 1994 return load_flags;
2002 } 1995 }
2003 1996
2004 } // namespace content 1997 } // namespace content
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/resource_dispatcher_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698