| 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" | |
| 60 // TODO(oshima): Enable this for other platforms. | 59 // TODO(oshima): Enable this for other platforms. |
| 61 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
| 62 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 61 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
| 63 #endif | 62 #endif |
| 64 | 63 |
| 65 using content::BrowserThread; | 64 using content::BrowserThread; |
| 66 using content::RenderViewHost; | 65 using content::RenderViewHost; |
| 67 using content::ResourceDispatcherHostLoginDelegate; | 66 using content::ResourceDispatcherHostLoginDelegate; |
| 68 using content::ResourceRequestInfo; | 67 using content::ResourceRequestInfo; |
| 69 | 68 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 content::InterceptNavigationDelegate::CreateThrottleFor( | 153 content::InterceptNavigationDelegate::CreateThrottleFor( |
| 155 request)); | 154 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 // 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)); | |
| 169 } | 163 } |
| 170 #endif | 164 #endif |
| 171 | 165 |
| 172 // Don't attempt to append headers to requests that have already started. | 166 // Don't attempt to append headers to requests that have already started. |
| 173 // TODO(stevet): Remove this once the request ordering issues are resolved | 167 // TODO(stevet): Remove this once the request ordering issues are resolved |
| 174 // in crbug.com/128048. | 168 // in crbug.com/128048. |
| 175 if (!request->is_pending()) { | 169 if (!request->is_pending()) { |
| 176 net::HttpRequestHeaders headers; | 170 net::HttpRequestHeaders headers; |
| 177 headers.CopyFrom(request->extra_request_headers()); | 171 headers.CopyFrom(request->extra_request_headers()); |
| 178 ProfileIOData* io_data = ProfileIOData::FromResourceContext( | 172 ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), | 426 OneClickSigninHelper::ShowInfoBarIfPossible(request, info->GetChildID(), |
| 433 info->GetRouteID()); | 427 info->GetRouteID()); |
| 434 #endif | 428 #endif |
| 435 | 429 |
| 436 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 430 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 437 if (io_data->resource_prefetch_predictor_observer()) { | 431 if (io_data->resource_prefetch_predictor_observer()) { |
| 438 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( | 432 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( |
| 439 redirect_url, request); | 433 redirect_url, request); |
| 440 } | 434 } |
| 441 } | 435 } |
| OLD | NEW |