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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "net/http/http_response_headers.h" | 44 #include "net/http/http_response_headers.h" |
45 #include "net/url_request/url_request.h" | 45 #include "net/url_request/url_request.h" |
46 | 46 |
47 #if defined(USE_SYSTEM_PROTOBUF) | 47 #if defined(USE_SYSTEM_PROTOBUF) |
48 #include <google/protobuf/repeated_field.h> | 48 #include <google/protobuf/repeated_field.h> |
49 #else | 49 #else |
50 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 50 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
51 #endif | 51 #endif |
52 | 52 |
53 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
54 #include "content/components/navigation_interception/intercept_navigation_delega
te.h" | 54 #include "components/navigation_interception/intercept_navigation_delegate.h" |
55 #else | 55 #else |
56 #include "chrome/browser/managed_mode/managed_mode_resource_throttle.h" | 56 #include "chrome/browser/managed_mode/managed_mode_resource_throttle.h" |
57 #endif | 57 #endif |
58 | 58 |
59 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
60 #include "chrome/browser/chromeos/extensions/file_browser_resource_throttle.h" | 60 #include "chrome/browser/chromeos/extensions/file_browser_resource_throttle.h" |
61 // TODO(oshima): Enable this for other platforms. | 61 // TODO(oshima): Enable this for other platforms. |
62 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 62 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
63 #endif | 63 #endif |
64 | 64 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 bool is_prerendering = prerender_tracker_->IsPrerenderingOnIOThread( | 144 bool is_prerendering = prerender_tracker_->IsPrerenderingOnIOThread( |
145 child_id, route_id); | 145 child_id, route_id); |
146 if (is_prerendering) { | 146 if (is_prerendering) { |
147 user_data->set_is_prerender(true); | 147 user_data->set_is_prerender(true); |
148 request->set_priority(net::IDLE); | 148 request->set_priority(net::IDLE); |
149 } | 149 } |
150 | 150 |
151 #if defined(OS_ANDROID) | 151 #if defined(OS_ANDROID) |
152 if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME) { | 152 if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME) { |
153 throttles->push_back( | 153 throttles->push_back( |
154 content::InterceptNavigationDelegate::CreateThrottleFor( | 154 components::InterceptNavigationDelegate::CreateThrottleFor(request)); |
155 request)); | |
156 } | 155 } |
157 #endif | 156 #endif |
158 #if defined(OS_CHROMEOS) | 157 #if defined(OS_CHROMEOS) |
159 if (resource_type == ResourceType::MAIN_FRAME) { | 158 if (resource_type == ResourceType::MAIN_FRAME) { |
160 // We check offline first, then check safe browsing so that we still can | 159 // We check offline first, then check safe browsing so that we still can |
161 // block unsafe site after we remove offline page. | 160 // block unsafe site after we remove offline page. |
162 throttles->push_back(new OfflineResourceThrottle( | 161 throttles->push_back(new OfflineResourceThrottle( |
163 child_id, route_id, request, appcache_service)); | 162 child_id, route_id, request, appcache_service)); |
164 } | 163 } |
165 #endif | 164 #endif |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), | 439 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), |
441 info->GetRouteID()); | 440 info->GetRouteID()); |
442 #endif | 441 #endif |
443 | 442 |
444 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 443 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
445 if (io_data->resource_prefetch_predictor_observer()) { | 444 if (io_data->resource_prefetch_predictor_observer()) { |
446 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( | 445 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( |
447 redirect_url, request); | 446 redirect_url, request); |
448 } | 447 } |
449 } | 448 } |
OLD | NEW |