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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 return false; | 234 return false; |
235 } | 235 } |
236 | 236 |
237 ResourceDispatcherHostLoginDelegate* | 237 ResourceDispatcherHostLoginDelegate* |
238 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( | 238 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( |
239 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { | 239 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { |
240 return CreateLoginPrompt(auth_info, request); | 240 return CreateLoginPrompt(auth_info, request); |
241 } | 241 } |
242 | 242 |
243 void ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( | 243 bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( |
244 const GURL& url, int child_id, int route_id) { | 244 const GURL& url, int child_id, int route_id) { |
| 245 #if defined(OS_ANDROID) |
| 246 // Android use a resource throttle to handle external as well as internal |
| 247 // protocols. |
| 248 return false; |
| 249 #else |
245 BrowserThread::PostTask( | 250 BrowserThread::PostTask( |
246 BrowserThread::UI, FROM_HERE, | 251 BrowserThread::UI, FROM_HERE, |
247 base::Bind(&ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); | 252 base::Bind(&ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); |
| 253 return true; |
| 254 #endif |
248 } | 255 } |
249 | 256 |
250 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( | 257 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( |
251 const net::URLRequest* request, | 258 const net::URLRequest* request, |
252 content::ResourceContext* resource_context, | 259 content::ResourceContext* resource_context, |
253 int child_id, | 260 int child_id, |
254 int route_id, | 261 int route_id, |
255 ResourceType::Type resource_type, | 262 ResourceType::Type resource_type, |
256 ScopedVector<content::ResourceThrottle>* throttles) { | 263 ScopedVector<content::ResourceThrottle>* throttles) { |
257 #if defined(ENABLE_SAFE_BROWSING) | 264 #if defined(ENABLE_SAFE_BROWSING) |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 if (base::Base64Encode(serialized, &hashed)) { | 464 if (base::Base64Encode(serialized, &hashed)) { |
458 // If successful, swap the header value with the new one. | 465 // If successful, swap the header value with the new one. |
459 // Note that the list of IDs and the header could be temporarily out of sync | 466 // Note that the list of IDs and the header could be temporarily out of sync |
460 // if IDs are added as the header is recreated. The receiving servers are OK | 467 // if IDs are added as the header is recreated. The receiving servers are OK |
461 // with such descrepancies. | 468 // with such descrepancies. |
462 variation_ids_header_ = hashed; | 469 variation_ids_header_ = hashed; |
463 } else { | 470 } else { |
464 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; | 471 DVLOG(1) << "Failed to base64 encode Variation IDs value: " << serialized; |
465 } | 472 } |
466 } | 473 } |
OLD | NEW |