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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 ProfileIOData* ProfileIOData::FromResourceContext( | 272 ProfileIOData* ProfileIOData::FromResourceContext( |
273 content::ResourceContext* rc) { | 273 content::ResourceContext* rc) { |
274 return (static_cast<ResourceContext*>(rc))->io_data_; | 274 return (static_cast<ResourceContext*>(rc))->io_data_; |
275 } | 275 } |
276 | 276 |
277 // static | 277 // static |
278 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { | 278 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { |
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::kExtensionResourceScheme, | |
Tom Sepez
2012/04/11 20:31:16
A compulsive person would insist on alphabetizing,
Peng
2012/04/11 21:40:13
I guess is by frequency of access. Done.
| |
282 chrome::kChromeUIScheme, | 283 chrome::kChromeUIScheme, |
283 chrome::kChromeDevToolsScheme, | 284 chrome::kChromeDevToolsScheme, |
284 #if defined(OS_CHROMEOS) | 285 #if defined(OS_CHROMEOS) |
285 chrome::kMetadataScheme, | 286 chrome::kMetadataScheme, |
286 #endif // defined(OS_CHROMEOS) | 287 #endif // defined(OS_CHROMEOS) |
287 chrome::kBlobScheme, | 288 chrome::kBlobScheme, |
288 chrome::kFileSystemScheme, | 289 chrome::kFileSystemScheme, |
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]) |
(...skipping 174 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)); | |
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 |