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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 "content/components/navigation_interception/intercept_navigation_delega
te.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 #include "chrome/browser/chromeos/login/merge_session_throttle.h" |
59 // TODO(oshima): Enable this for other platforms. | 60 // TODO(oshima): Enable this for other platforms. |
60 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
61 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 62 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
62 #endif | 63 #endif |
63 | 64 |
64 using content::BrowserThread; | 65 using content::BrowserThread; |
65 using content::RenderViewHost; | 66 using content::RenderViewHost; |
66 using content::ResourceDispatcherHostLoginDelegate; | 67 using content::ResourceDispatcherHostLoginDelegate; |
67 using content::ResourceRequestInfo; | 68 using content::ResourceRequestInfo; |
68 | 69 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 content::InterceptNavigationDelegate::CreateThrottleFor( | 154 content::InterceptNavigationDelegate::CreateThrottleFor( |
154 request)); | 155 request)); |
155 } | 156 } |
156 #endif | 157 #endif |
157 #if defined(OS_CHROMEOS) | 158 #if defined(OS_CHROMEOS) |
158 if (resource_type == ResourceType::MAIN_FRAME) { | 159 if (resource_type == ResourceType::MAIN_FRAME) { |
159 // We check offline first, then check safe browsing so that we still can | 160 // We check offline first, then check safe browsing so that we still can |
160 // block unsafe site after we remove offline page. | 161 // block unsafe site after we remove offline page. |
161 throttles->push_back(new OfflineResourceThrottle( | 162 throttles->push_back(new OfflineResourceThrottle( |
162 child_id, route_id, request, appcache_service)); | 163 child_id, route_id, request, appcache_service)); |
| 164 // Add interstitial page while merge session process (cookie |
| 165 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
| 166 // progress while we are attempting to load a google property. |
| 167 throttles->push_back(new MergeSessionThrottle( |
| 168 child_id, route_id, request)); |
163 } | 169 } |
164 #endif | 170 #endif |
165 | 171 |
166 // Don't attempt to append headers to requests that have already started. | 172 // Don't attempt to append headers to requests that have already started. |
167 // TODO(stevet): Remove this once the request ordering issues are resolved | 173 // TODO(stevet): Remove this once the request ordering issues are resolved |
168 // in crbug.com/128048. | 174 // in crbug.com/128048. |
169 if (!request->is_pending()) { | 175 if (!request->is_pending()) { |
170 net::HttpRequestHeaders headers; | 176 net::HttpRequestHeaders headers; |
171 headers.CopyFrom(request->extra_request_headers()); | 177 headers.CopyFrom(request->extra_request_headers()); |
172 ProfileIOData* io_data = ProfileIOData::FromResourceContext( | 178 ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), | 432 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), |
427 info->GetRouteID()); | 433 info->GetRouteID()); |
428 #endif | 434 #endif |
429 | 435 |
430 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 436 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
431 if (io_data->resource_prefetch_predictor_observer()) { | 437 if (io_data->resource_prefetch_predictor_observer()) { |
432 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( | 438 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( |
433 redirect_url, request); | 439 redirect_url, request); |
434 } | 440 } |
435 } | 441 } |
OLD | NEW |