| 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 DCHECK(set_protocol); |
| 480 set_protocol = job_factory_->SetProtocolHandler( |
| 476 chrome::kChromeUIScheme, | 481 chrome::kChromeUIScheme, |
| 477 ChromeURLDataManagerBackend::CreateProtocolHandler( | 482 ChromeURLDataManagerBackend::CreateProtocolHandler( |
| 478 chrome_url_data_manager_backend_.get())); | 483 chrome_url_data_manager_backend_.get())); |
| 479 DCHECK(set_protocol); | 484 DCHECK(set_protocol); |
| 480 set_protocol = job_factory_->SetProtocolHandler( | 485 set_protocol = job_factory_->SetProtocolHandler( |
| 481 chrome::kChromeDevToolsScheme, | 486 chrome::kChromeDevToolsScheme, |
| 482 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); | 487 CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); |
| 483 DCHECK(set_protocol); | 488 DCHECK(set_protocol); |
| 484 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 489 #if defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
| 485 // Install the GView request interceptor that will redirect requests | 490 // Install the GView request interceptor that will redirect requests |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 #endif | 532 #endif |
| 528 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 533 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| 529 if (!posted) | 534 if (!posted) |
| 530 delete this; | 535 delete this; |
| 531 } | 536 } |
| 532 | 537 |
| 533 void ProfileIOData::set_server_bound_cert_service( | 538 void ProfileIOData::set_server_bound_cert_service( |
| 534 net::ServerBoundCertService* server_bound_cert_service) const { | 539 net::ServerBoundCertService* server_bound_cert_service) const { |
| 535 server_bound_cert_service_.reset(server_bound_cert_service); | 540 server_bound_cert_service_.reset(server_bound_cert_service); |
| 536 } | 541 } |
| OLD | NEW |