| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 return false; | 247 return false; |
| 248 } | 248 } |
| 249 | 249 |
| 250 ResourceDispatcherHostLoginDelegate* | 250 ResourceDispatcherHostLoginDelegate* |
| 251 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( | 251 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( |
| 252 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { | 252 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { |
| 253 return CreateLoginPrompt(auth_info, request); | 253 return CreateLoginPrompt(auth_info, request); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( | 256 bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( |
| 257 const GURL& url, int child_id, int route_id) { | 257 const GURL& url, int child_id, int route_id) { |
| 258 #if defined(OS_ANDROID) |
| 259 // Android use a resource throttle to handle external as well as internal |
| 260 // protocols. |
| 261 return false; |
| 262 #else |
| 258 BrowserThread::PostTask( | 263 BrowserThread::PostTask( |
| 259 BrowserThread::UI, FROM_HERE, | 264 BrowserThread::UI, FROM_HERE, |
| 260 base::Bind(&ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); | 265 base::Bind(&ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); |
| 266 return true; |
| 267 #endif |
| 261 } | 268 } |
| 262 | 269 |
| 263 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( | 270 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( |
| 264 const net::URLRequest* request, | 271 const net::URLRequest* request, |
| 265 content::ResourceContext* resource_context, | 272 content::ResourceContext* resource_context, |
| 266 int child_id, | 273 int child_id, |
| 267 int route_id, | 274 int route_id, |
| 268 ResourceType::Type resource_type, | 275 ResourceType::Type resource_type, |
| 269 ScopedVector<content::ResourceThrottle>* throttles) { | 276 ScopedVector<content::ResourceThrottle>* throttles) { |
| 270 #if defined(ENABLE_SAFE_BROWSING) | 277 #if defined(ENABLE_SAFE_BROWSING) |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (base::Base64Encode(serialized, &hashed)) { | 477 if (base::Base64Encode(serialized, &hashed)) { |
| 471 // If successful, swap the header value with the new one. | 478 // If successful, swap the header value with the new one. |
| 472 // Note that the list of IDs and the header could be temporarily out of sync | 479 // Note that the list of IDs and the header could be temporarily out of sync |
| 473 // if IDs are added as the header is recreated. The receiving servers are OK | 480 // if IDs are added as the header is recreated. The receiving servers are OK |
| 474 // with such descrepancies. | 481 // with such descrepancies. |
| 475 variation_ids_header_ = hashed; | 482 variation_ids_header_ = hashed; |
| 476 } else { | 483 } else { |
| 477 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; | 484 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; |
| 478 } | 485 } |
| 479 } | 486 } |
| OLD | NEW |