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_manager_factory.h" | 22 #include "chrome/browser/prerender/prerender_manager_factory.h" |
23 #include "chrome/browser/prerender/prerender_tracker.h" | 23 #include "chrome/browser/prerender/prerender_tracker.h" |
24 #include "chrome/browser/profiles/profile_io_data.h" | 24 #include "chrome/browser/profiles/profile_io_data.h" |
25 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" | 25 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" |
26 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 26 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
27 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" | 27 #include "chrome/browser/renderer_host/transfer_navigation_resource_throttle.h" |
28 #include "chrome/browser/renderer_host/should_ignore_navigation_resource_throttl e.h" | |
28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 29 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
29 #include "chrome/browser/ui/auto_login_prompter.h" | 30 #include "chrome/browser/ui/auto_login_prompter.h" |
30 #include "chrome/browser/ui/login/login_prompt.h" | 31 #include "chrome/browser/ui/login/login_prompt.h" |
31 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 32 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
32 #include "chrome/common/chrome_notification_types.h" | 33 #include "chrome/common/chrome_notification_types.h" |
33 #include "chrome/common/extensions/user_script.h" | 34 #include "chrome/common/extensions/user_script.h" |
34 #include "chrome/common/metrics/experiments_helper.h" | 35 #include "chrome/common/metrics/experiments_helper.h" |
35 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" | 36 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" |
36 #include "chrome/common/render_messages.h" | 37 #include "chrome/common/render_messages.h" |
37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 | 179 |
179 if (resource_type == ResourceType::MAIN_FRAME) { | 180 if (resource_type == ResourceType::MAIN_FRAME) { |
180 throttles->push_back(new TransferNavigationResourceThrottle(request)); | 181 throttles->push_back(new TransferNavigationResourceThrottle(request)); |
181 | 182 |
182 #if defined(OS_CHROMEOS) | 183 #if defined(OS_CHROMEOS) |
183 // We check offline first, then check safe browsing so that we still can | 184 // We check offline first, then check safe browsing so that we still can |
184 // block unsafe site after we remove offline page. | 185 // block unsafe site after we remove offline page. |
185 throttles->push_back(new OfflineResourceThrottle( | 186 throttles->push_back(new OfflineResourceThrottle( |
186 child_id, route_id, request, resource_context)); | 187 child_id, route_id, request, resource_context)); |
187 #endif | 188 #endif |
189 | |
190 #if defined(OS_ANDROID) | |
191 throttles->push_back(new ShouldIgnoreNavigationResourceThrottle(request)); | |
Charlie Reis
2012/05/17 22:18:57
nit: IgnoreNavigationResourceThrottle seems more c
mkosiba (inactive)
2012/05/18 12:33:01
Done.
| |
192 #endif | |
188 } | 193 } |
189 | 194 |
190 AppendChromeMetricsHeaders(request, resource_context, resource_type); | 195 AppendChromeMetricsHeaders(request, resource_context, resource_type); |
191 | 196 |
192 AppendStandardResourceThrottles(request, | 197 AppendStandardResourceThrottles(request, |
193 resource_context, | 198 resource_context, |
194 child_id, | 199 child_id, |
195 route_id, | 200 route_id, |
196 resource_type, | 201 resource_type, |
197 throttles); | 202 throttles); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
455 if (base::Base64Encode(serialized, &hashed)) { | 460 if (base::Base64Encode(serialized, &hashed)) { |
456 // If successful, swap the header value with the new one. | 461 // If successful, swap the header value with the new one. |
457 // Note that the list of IDs and the header could be temporarily out of sync | 462 // Note that the list of IDs and the header could be temporarily out of sync |
458 // if IDs are added as we are recreating the header, but we're OK with those | 463 // if IDs are added as we are recreating the header, but we're OK with those |
459 // descrepancies. | 464 // descrepancies. |
460 variation_ids_header_ = hashed; | 465 variation_ids_header_ = hashed; |
461 } else { | 466 } else { |
462 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; | 467 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; |
463 } | 468 } |
464 } | 469 } |
OLD | NEW |