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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); | 279 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); |
280 static const char* const kProtocolList[] = { | 280 static const char* const kProtocolList[] = { |
281 chrome::kExtensionScheme, | 281 chrome::kExtensionScheme, |
282 chrome::kChromeUIScheme, | 282 chrome::kChromeUIScheme, |
283 chrome::kChromeDevToolsScheme, | 283 chrome::kChromeDevToolsScheme, |
284 #if defined(OS_CHROMEOS) | 284 #if defined(OS_CHROMEOS) |
285 chrome::kMetadataScheme, | 285 chrome::kMetadataScheme, |
286 #endif // defined(OS_CHROMEOS) | 286 #endif // defined(OS_CHROMEOS) |
287 chrome::kBlobScheme, | 287 chrome::kBlobScheme, |
288 chrome::kFileSystemScheme, | 288 chrome::kFileSystemScheme, |
289 chrome::kExtensionResourceScheme, | |
289 }; | 290 }; |
290 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 291 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
291 if (scheme == kProtocolList[i]) | 292 if (scheme == kProtocolList[i]) |
292 return true; | 293 return true; |
293 } | 294 } |
294 return net::URLRequest::IsHandledProtocol(scheme); | 295 return net::URLRequest::IsHandledProtocol(scheme); |
295 } | 296 } |
296 | 297 |
297 bool ProfileIOData::IsHandledURL(const GURL& url) { | 298 bool ProfileIOData::IsHandledURL(const GURL& url) { |
298 if (!url.is_valid()) { | 299 if (!url.is_valid()) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 job_factory_->AddInterceptor( | 467 job_factory_->AddInterceptor( |
467 new ProtocolHandlerRegistryInterceptor( | 468 new ProtocolHandlerRegistryInterceptor( |
468 profile_params_->protocol_handler_registry)); | 469 profile_params_->protocol_handler_registry)); |
469 } | 470 } |
470 bool set_protocol = job_factory_->SetProtocolHandler( | 471 bool set_protocol = job_factory_->SetProtocolHandler( |
471 chrome::kExtensionScheme, | 472 chrome::kExtensionScheme, |
472 CreateExtensionProtocolHandler(profile_params_->is_incognito, | 473 CreateExtensionProtocolHandler(profile_params_->is_incognito, |
473 profile_params_->extension_info_map)); | 474 profile_params_->extension_info_map)); |
474 DCHECK(set_protocol); | 475 DCHECK(set_protocol); |
475 set_protocol = job_factory_->SetProtocolHandler( | 476 set_protocol = job_factory_->SetProtocolHandler( |
477 chrome::kExtensionResourceScheme, | |
478 CreateExtensionResourceProtocolHandler( | |
479 profile_params_->is_incognito, | |
480 profile_params_->extension_info_map)); | |
miket_OOO
2012/04/12 18:38:39
See earlier comment -- can we get rid of the param
Peng
2012/04/12 20:13:22
Done.
| |
481 DCHECK(set_protocol); | |
482 set_protocol = job_factory_->SetProtocolHandler( | |
476 chrome::kChromeUIScheme, | 483 chrome::kChromeUIScheme, |
477 ChromeURLDataManagerBackend::CreateProtocolHandler( | 484 ChromeURLDataManagerBackend::CreateProtocolHandler( |
478 chrome_url_data_manager_backend_.get())); | 485 chrome_url_data_manager_backend_.get())); |
479 DCHECK(set_protocol); | 486 DCHECK(set_protocol); |
480 set_protocol = job_factory_->SetProtocolHandler( | 487 set_protocol = job_factory_->SetProtocolHandler( |
481 chrome::kChromeDevToolsScheme, | 488 chrome::kChromeDevToolsScheme, |
482 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); | 489 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); |
483 DCHECK(set_protocol); | 490 DCHECK(set_protocol); |
484 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 491 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
485 // Install the GView request interceptor that will redirect requests | 492 // Install the GView request interceptor that will redirect requests |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 #endif | 534 #endif |
528 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 535 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
529 if (!posted) | 536 if (!posted) |
530 delete this; | 537 delete this; |
531 } | 538 } |
532 | 539 |
533 void ProfileIOData::set_server_bound_cert_service( | 540 void ProfileIOData::set_server_bound_cert_service( |
534 net::ServerBoundCertService* server_bound_cert_service) const { | 541 net::ServerBoundCertService* server_bound_cert_service) const { |
535 server_bound_cert_service_.reset(server_bound_cert_service); | 542 server_bound_cert_service_.reset(server_bound_cert_service); |
536 } | 543 } |
OLD | NEW |