OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |