| 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 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/content_settings/host_content_settings_map.h" | 12 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 13 #include "chrome/browser/download/download_request_limiter.h" | 13 #include "chrome/browser/download/download_request_limiter.h" |
| 14 #include "chrome/browser/download/download_resource_throttle.h" | 14 #include "chrome/browser/download/download_resource_throttle.h" |
| 15 #include "chrome/browser/download/download_util.h" | 15 #include "chrome/browser/download/download_util.h" |
| 16 #include "chrome/browser/extensions/user_script_listener.h" | 16 #include "chrome/browser/extensions/user_script_listener.h" |
| 17 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 17 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 18 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
| 19 #include "chrome/browser/instant/instant_loader.h" | 19 #include "chrome/browser/instant/instant_loader.h" |
| 20 #include "chrome/browser/net/load_timing_observer.h" | 20 #include "chrome/browser/net/load_timing_observer.h" |
| 21 #include "chrome/browser/prerender/prerender_manager.h" | 21 #include "chrome/browser/prerender/prerender_manager.h" |
| 22 #include "chrome/browser/prerender/prerender_tracker.h" | 22 #include "chrome/browser/prerender/prerender_tracker.h" |
| 23 #include "chrome/browser/profiles/profile_io_data.h" | 23 #include "chrome/browser/profiles/profile_io_data.h" |
| 24 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" | 24 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" |
| 25 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 25 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
| 26 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" | 26 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" |
| 27 #include "chrome/browser/renderer_host/ignore_navigation_resource_throttle.h" |
| 27 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 28 #include "chrome/browser/ui/auto_login_prompter.h" | 29 #include "chrome/browser/ui/auto_login_prompter.h" |
| 29 #include "chrome/browser/ui/login/login_prompt.h" | 30 #include "chrome/browser/ui/login/login_prompt.h" |
| 30 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 31 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 32 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/extensions/user_script.h" | 33 #include "chrome/common/extensions/user_script.h" |
| 33 #include "chrome/common/metrics/experiments_helper.h" | 34 #include "chrome/common/metrics/experiments_helper.h" |
| 34 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" | 35 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" |
| 35 #include "chrome/common/render_messages.h" | 36 #include "chrome/common/render_messages.h" |
| 36 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 136 |
| 136 if (resource_type == ResourceType::MAIN_FRAME) { | 137 if (resource_type == ResourceType::MAIN_FRAME) { |
| 137 throttles->push_back(new TransferNavigationResourceThrottle(request)); | 138 throttles->push_back(new TransferNavigationResourceThrottle(request)); |
| 138 | 139 |
| 139 #if defined(OS_CHROMEOS) | 140 #if defined(OS_CHROMEOS) |
| 140 // We check offline first, then check safe browsing so that we still can | 141 // We check offline first, then check safe browsing so that we still can |
| 141 // block unsafe site after we remove offline page. | 142 // block unsafe site after we remove offline page. |
| 142 throttles->push_back(new OfflineResourceThrottle( | 143 throttles->push_back(new OfflineResourceThrottle( |
| 143 child_id, route_id, request, resource_context)); | 144 child_id, route_id, request, resource_context)); |
| 144 #endif | 145 #endif |
| 146 |
| 147 #if defined(OS_ANDROID) |
| 148 throttles->push_back(new IgnoreNavigationResourceThrottle(request)); |
| 149 #endif |
| 145 } | 150 } |
| 146 | 151 |
| 147 AppendChromeMetricsHeaders(request, resource_context, resource_type); | 152 AppendChromeMetricsHeaders(request, resource_context, resource_type); |
| 148 | 153 |
| 149 AppendStandardResourceThrottles(request, | 154 AppendStandardResourceThrottles(request, |
| 150 resource_context, | 155 resource_context, |
| 151 child_id, | 156 child_id, |
| 152 route_id, | 157 route_id, |
| 153 resource_type, | 158 resource_type, |
| 154 throttles); | 159 throttles); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (base::Base64Encode(serialized, &hashed)) { | 418 if (base::Base64Encode(serialized, &hashed)) { |
| 414 // If successful, swap the header value with the new one. | 419 // If successful, swap the header value with the new one. |
| 415 // Note that the list of IDs and the header could be temporarily out of sync | 420 // Note that the list of IDs and the header could be temporarily out of sync |
| 416 // if IDs are added as we are recreating the header, but we're OK with those | 421 // if IDs are added as we are recreating the header, but we're OK with those |
| 417 // descrepancies. | 422 // descrepancies. |
| 418 variation_ids_header_ = hashed; | 423 variation_ids_header_ = hashed; |
| 419 } else { | 424 } else { |
| 420 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; | 425 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; |
| 421 } | 426 } |
| 422 } | 427 } |
| OLD | NEW |