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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 g_external_protocol_handler_delegate); | 183 g_external_protocol_handler_delegate); |
184 } | 184 } |
185 #endif // !defined(OS_ANDROID) | 185 #endif // !defined(OS_ANDROID) |
186 | 186 |
187 void AppendComponentUpdaterThrottles( | 187 void AppendComponentUpdaterThrottles( |
188 net::URLRequest* request, | 188 net::URLRequest* request, |
189 content::ResourceContext* resource_context, | 189 content::ResourceContext* resource_context, |
190 ResourceType::Type resource_type, | 190 ResourceType::Type resource_type, |
191 ScopedVector<content::ResourceThrottle>* throttles) { | 191 ScopedVector<content::ResourceThrottle>* throttles) { |
192 const char* crx_id = NULL; | 192 const char* crx_id = NULL; |
193 ComponentUpdateService* cus = g_browser_process->component_updater(); | 193 component_updater::ComponentUpdateService* cus = |
| 194 g_browser_process->component_updater(); |
194 if (!cus) | 195 if (!cus) |
195 return; | 196 return; |
196 // Check for PNaCl pexe request. | 197 // Check for PNaCl pexe request. |
197 if (resource_type == ResourceType::OBJECT) { | 198 if (resource_type == ResourceType::OBJECT) { |
198 const net::HttpRequestHeaders& headers = request->extra_request_headers(); | 199 const net::HttpRequestHeaders& headers = request->extra_request_headers(); |
199 std::string accept_headers; | 200 std::string accept_headers; |
200 if (headers.GetHeader("Accept", &accept_headers)) { | 201 if (headers.GetHeader("Accept", &accept_headers)) { |
201 if (accept_headers.find("application/x-pnacl") != std::string::npos && | 202 if (accept_headers.find("application/x-pnacl") != std::string::npos && |
202 pnacl::NeedsOnDemandUpdate()) | 203 pnacl::NeedsOnDemandUpdate()) |
203 crx_id = "hnimpnehoodheedghdeeijklkeaacbdc"; | 204 crx_id = "hnimpnehoodheedghdeeijklkeaacbdc"; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data, | 628 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data, |
628 info->GetChildID(), info->GetRouteID()); | 629 info->GetChildID(), info->GetRouteID()); |
629 } | 630 } |
630 | 631 |
631 // static | 632 // static |
632 void ChromeResourceDispatcherHostDelegate:: | 633 void ChromeResourceDispatcherHostDelegate:: |
633 SetExternalProtocolHandlerDelegateForTesting( | 634 SetExternalProtocolHandlerDelegateForTesting( |
634 ExternalProtocolHandler::Delegate* delegate) { | 635 ExternalProtocolHandler::Delegate* delegate) { |
635 g_external_protocol_handler_delegate = delegate; | 636 g_external_protocol_handler_delegate = delegate; |
636 } | 637 } |
OLD | NEW |