| 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_resource_throttle.h
" | 15 #include "chrome/browser/component_updater/component_updater_resource_throttle.h
" |
| 16 #include "chrome/browser/download/download_request_limiter.h" | 16 #include "chrome/browser/download/download_request_limiter.h" |
| 17 #include "chrome/browser/download/download_resource_throttle.h" | 17 #include "chrome/browser/download/download_resource_throttle.h" |
| 18 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h" | 18 #include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h" |
| 19 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" | 19 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
| 20 #include "chrome/browser/plugins/plugin_prefs.h" | 20 #include "chrome/browser/plugins/plugin_prefs.h" |
| 21 #include "chrome/browser/prefetch/prefetch.h" | 21 #include "chrome/browser/prefetch/prefetch.h" |
| 22 #include "chrome/browser/prerender/prerender_manager.h" | 22 #include "chrome/browser/prerender/prerender_manager.h" |
| 23 #include "chrome/browser/prerender/prerender_manager_factory.h" | 23 #include "chrome/browser/prerender/prerender_manager_factory.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_util.h" | 25 #include "chrome/browser/prerender/prerender_util.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/profiles/profile_io_data.h" | 27 #include "chrome/browser/profiles/profile_io_data.h" |
| 28 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an
droid.h" | |
| 29 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 28 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
| 30 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" | 29 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" |
| 31 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 30 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 32 #include "chrome/browser/signin/chrome_signin_helper.h" | 31 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 33 #include "chrome/browser/tab_contents/tab_util.h" | 32 #include "chrome/browser/tab_contents/tab_util.h" |
| 34 #include "chrome/browser/ui/login/login_prompt.h" | 33 #include "chrome/browser/ui/login/login_prompt.h" |
| 35 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 37 #include "components/content_settings/core/browser/host_content_settings_map.h" | 36 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 37 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 #if defined(ENABLE_SUPERVISED_USERS) | 80 #if defined(ENABLE_SUPERVISED_USERS) |
| 82 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" | 81 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" |
| 83 #endif | 82 #endif |
| 84 | 83 |
| 85 #if defined(USE_SYSTEM_PROTOBUF) | 84 #if defined(USE_SYSTEM_PROTOBUF) |
| 86 #include <google/protobuf/repeated_field.h> | 85 #include <google/protobuf/repeated_field.h> |
| 87 #else | 86 #else |
| 88 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 87 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 89 #endif | 88 #endif |
| 90 | 89 |
| 90 #if defined(ANDROID_JAVA_UI) |
| 91 #include "chrome/browser/android/intercept_download_resource_throttle.h" |
| 92 #endif |
| 93 |
| 91 #if defined(OS_ANDROID) | 94 #if defined(OS_ANDROID) |
| 92 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 95 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an
droid.h" |
| 93 #include "components/navigation_interception/intercept_navigation_delegate.h" | 96 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 94 #endif | 97 #endif |
| 95 | 98 |
| 96 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) | 99 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) |
| 97 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_d
ebug_resource_throttle.h" | 100 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_d
ebug_resource_throttle.h" |
| 98 #endif | 101 #endif |
| 99 | 102 |
| 100 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
| 101 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" | 104 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" |
| 102 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 105 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 ScopedVector<content::ResourceThrottle>* throttles) { | 418 ScopedVector<content::ResourceThrottle>* throttles) { |
| 416 BrowserThread::PostTask( | 419 BrowserThread::PostTask( |
| 417 BrowserThread::UI, FROM_HERE, | 420 BrowserThread::UI, FROM_HERE, |
| 418 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); | 421 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); |
| 419 | 422 |
| 420 // If it's from the web, we don't trust it, so we push the throttle on. | 423 // If it's from the web, we don't trust it, so we push the throttle on. |
| 421 if (is_content_initiated) { | 424 if (is_content_initiated) { |
| 422 throttles->push_back(new DownloadResourceThrottle( | 425 throttles->push_back(new DownloadResourceThrottle( |
| 423 download_request_limiter_, child_id, route_id, request->url(), | 426 download_request_limiter_, child_id, route_id, request->url(), |
| 424 request->method())); | 427 request->method())); |
| 425 #if defined(OS_ANDROID) | 428 #if defined(ANDROID_JAVA_UI) |
| 426 throttles->push_back( | 429 throttles->push_back( |
| 427 new chrome::InterceptDownloadResourceThrottle( | 430 new chrome::InterceptDownloadResourceThrottle( |
| 428 request, child_id, route_id, request_id)); | 431 request, child_id, route_id, request_id)); |
| 429 #endif | 432 #endif |
| 430 } | 433 } |
| 431 | 434 |
| 432 // If this isn't a new request, we've seen this before and added the standard | 435 // If this isn't a new request, we've seen this before and added the standard |
| 433 // resource throttles already so no need to add it again. | 436 // resource throttles already so no need to add it again. |
| 434 if (!request->is_pending()) { | 437 if (!request->is_pending()) { |
| 435 AppendStandardResourceThrottles(request, | 438 AppendStandardResourceThrottles(request, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 740 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); |
| 738 return false; | 741 return false; |
| 739 } | 742 } |
| 740 | 743 |
| 741 // static | 744 // static |
| 742 void ChromeResourceDispatcherHostDelegate:: | 745 void ChromeResourceDispatcherHostDelegate:: |
| 743 SetExternalProtocolHandlerDelegateForTesting( | 746 SetExternalProtocolHandlerDelegateForTesting( |
| 744 ExternalProtocolHandler::Delegate* delegate) { | 747 ExternalProtocolHandler::Delegate* delegate) { |
| 745 g_external_protocol_handler_delegate = delegate; | 748 g_external_protocol_handler_delegate = delegate; |
| 746 } | 749 } |
| OLD | NEW |