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

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

Issue 131783012: Fix the handling of user gestures for external protocol handler dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary DCHECK Created 6 years, 8 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); 672 ResourceRequestInfoImpl* info = loader->GetRequestInfo();
673 673
674 if (!ResourceType::IsFrame(info->GetResourceType())) 674 if (!ResourceType::IsFrame(info->GetResourceType()))
675 return false; 675 return false;
676 676
677 const net::URLRequestJobFactory* job_factory = 677 const net::URLRequestJobFactory* job_factory =
678 info->GetContext()->GetRequestContext()->job_factory(); 678 info->GetContext()->GetRequestContext()->job_factory();
679 if (job_factory->IsHandledURL(url)) 679 if (job_factory->IsHandledURL(url))
680 return false; 680 return false;
681 681
682 return delegate_->HandleExternalProtocol(url, info->GetChildID(), 682 bool initiated_by_user_gesture =
683 info->GetRouteID()); 683 (loader->request()->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0;
684 bool handled = delegate_->HandleExternalProtocol(url, info->GetChildID(),
685 info->GetRouteID(),
686 initiated_by_user_gesture);
687 // Consume the user gesture if the external protocol dialog is shown.
688 if (handled)
689 last_user_gesture_time_ = base::TimeTicks();
690 return handled;
684 } 691 }
685 692
686 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { 693 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) {
687 // Make sure we have the load state monitor running 694 // Make sure we have the load state monitor running
688 if (!update_load_states_timer_->IsRunning()) { 695 if (!update_load_states_timer_->IsRunning()) {
689 update_load_states_timer_->Start(FROM_HERE, 696 update_load_states_timer_->Start(FROM_HERE,
690 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec), 697 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec),
691 this, &ResourceDispatcherHostImpl::UpdateLoadStates); 698 this, &ResourceDispatcherHostImpl::UpdateLoadStates);
692 } 699 }
693 } 700 }
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 2034 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
2028 && !policy->CanReadRawCookies(child_id)) { 2035 && !policy->CanReadRawCookies(child_id)) {
2029 VLOG(1) << "Denied unauthorized request for raw headers"; 2036 VLOG(1) << "Denied unauthorized request for raw headers";
2030 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 2037 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
2031 } 2038 }
2032 2039
2033 return load_flags; 2040 return load_flags;
2034 } 2041 }
2035 2042
2036 } // namespace content 2043 } // 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