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 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
11 #include "base/guid.h" | 11 #include "base/guid.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
15 #include "chrome/browser/component_updater/component_updater_service.h" | 15 #include "chrome/browser/component_updater/component_updater_resource_throttle.h
" |
16 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" | 16 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" |
17 #include "chrome/browser/content_settings/host_content_settings_map.h" | 17 #include "chrome/browser/content_settings/host_content_settings_map.h" |
18 #include "chrome/browser/download/download_request_limiter.h" | 18 #include "chrome/browser/download/download_request_limiter.h" |
19 #include "chrome/browser/download/download_resource_throttle.h" | 19 #include "chrome/browser/download/download_resource_throttle.h" |
20 #include "chrome/browser/prefetch/prefetch.h" | 20 #include "chrome/browser/prefetch/prefetch.h" |
21 #include "chrome/browser/prerender/prerender_manager.h" | 21 #include "chrome/browser/prerender/prerender_manager.h" |
22 #include "chrome/browser/prerender/prerender_manager_factory.h" | 22 #include "chrome/browser/prerender/prerender_manager_factory.h" |
23 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h" | 23 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h" |
24 #include "chrome/browser/prerender/prerender_resource_throttle.h" | 24 #include "chrome/browser/prerender/prerender_resource_throttle.h" |
25 #include "chrome/browser/prerender/prerender_tracker.h" | 25 #include "chrome/browser/prerender/prerender_tracker.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (accept_headers.find("application/x-pnacl") != std::string::npos && | 241 if (accept_headers.find("application/x-pnacl") != std::string::npos && |
242 pnacl::NeedsOnDemandUpdate()) | 242 pnacl::NeedsOnDemandUpdate()) |
243 crx_id = "hnimpnehoodheedghdeeijklkeaacbdc"; | 243 crx_id = "hnimpnehoodheedghdeeijklkeaacbdc"; |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
247 if (crx_id) { | 247 if (crx_id) { |
248 // We got a component we need to install, so throttle the resource | 248 // We got a component we need to install, so throttle the resource |
249 // until the component is installed. | 249 // until the component is installed. |
250 throttles->push_back( | 250 throttles->push_back( |
251 cus->GetOnDemandUpdater().GetOnDemandResourceThrottle(request, crx_id)); | 251 component_updater::GetOnDemandResourceThrottle(cus, crx_id)); |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 } // end namespace | 255 } // end namespace |
256 | 256 |
257 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( | 257 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( |
258 prerender::PrerenderTracker* prerender_tracker) | 258 prerender::PrerenderTracker* prerender_tracker) |
259 : download_request_limiter_(g_browser_process->download_request_limiter()), | 259 : download_request_limiter_(g_browser_process->download_request_limiter()), |
260 safe_browsing_(g_browser_process->safe_browsing_service()), | 260 safe_browsing_(g_browser_process->safe_browsing_service()), |
261 #if defined(ENABLE_EXTENSIONS) | 261 #if defined(ENABLE_EXTENSIONS) |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 url_request->GetTotalReceivedBytes())); | 733 url_request->GetTotalReceivedBytes())); |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 // static | 737 // static |
738 void ChromeResourceDispatcherHostDelegate:: | 738 void ChromeResourceDispatcherHostDelegate:: |
739 SetExternalProtocolHandlerDelegateForTesting( | 739 SetExternalProtocolHandlerDelegateForTesting( |
740 ExternalProtocolHandler::Delegate* delegate) { | 740 ExternalProtocolHandler::Delegate* delegate) { |
741 g_external_protocol_handler_delegate = delegate; | 741 g_external_protocol_handler_delegate = delegate; |
742 } | 742 } |
OLD | NEW |