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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // static | 414 // static |
415 ProfileIOData* ProfileIOData::FromResourceContext( | 415 ProfileIOData* ProfileIOData::FromResourceContext( |
416 content::ResourceContext* rc) { | 416 content::ResourceContext* rc) { |
417 return (static_cast<ResourceContext*>(rc))->io_data_; | 417 return (static_cast<ResourceContext*>(rc))->io_data_; |
418 } | 418 } |
419 | 419 |
420 // static | 420 // static |
421 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { | 421 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { |
422 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); | 422 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); |
423 static const char* const kProtocolList[] = { | 423 static const char* const kProtocolList[] = { |
424 chrome::kFileScheme, | 424 extensions::kExtensionScheme, |
| 425 chrome::kChromeUIScheme, |
425 chrome::kChromeDevToolsScheme, | 426 chrome::kChromeDevToolsScheme, |
426 extensions::kExtensionScheme, | |
427 chrome::kExtensionResourceScheme, | |
428 chrome::kChromeUIScheme, | |
429 chrome::kDataScheme, | |
430 #if defined(OS_CHROMEOS) | 427 #if defined(OS_CHROMEOS) |
| 428 chrome::kMetadataScheme, |
431 chrome::kDriveScheme, | 429 chrome::kDriveScheme, |
432 #endif // defined(OS_CHROMEOS) | 430 #endif // defined(OS_CHROMEOS) |
433 chrome::kAboutScheme, | |
434 #if !defined(DISABLE_FTP_SUPPORT) | |
435 chrome::kFtpScheme, | |
436 #endif // !defined(DISABLE_FTP_SUPPORT) | |
437 chrome::kBlobScheme, | 431 chrome::kBlobScheme, |
438 chrome::kFileSystemScheme, | 432 chrome::kFileSystemScheme, |
| 433 chrome::kExtensionResourceScheme, |
439 chrome::kChromeSearchScheme, | 434 chrome::kChromeSearchScheme, |
440 }; | 435 }; |
441 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 436 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
442 if (scheme == kProtocolList[i]) | 437 if (scheme == kProtocolList[i]) |
443 return true; | 438 return true; |
444 } | 439 } |
445 return net::URLRequest::IsHandledProtocol(scheme); | 440 return net::URLRequest::IsHandledProtocol(scheme); |
446 } | 441 } |
447 | 442 |
448 // static | 443 // static |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 context->set_http_user_agent_settings( | 705 context->set_http_user_agent_settings( |
711 chrome_http_user_agent_settings_.get()); | 706 chrome_http_user_agent_settings_.get()); |
712 context->set_ssl_config_service(profile_params_->ssl_config_service); | 707 context->set_ssl_config_service(profile_params_->ssl_config_service); |
713 } | 708 } |
714 | 709 |
715 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( | 710 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( |
716 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, | 711 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, |
717 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 712 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
718 protocol_handler_interceptor, | 713 protocol_handler_interceptor, |
719 net::NetworkDelegate* network_delegate, | 714 net::NetworkDelegate* network_delegate, |
720 net::FtpTransactionFactory* ftp_transaction_factory) const { | 715 net::FtpTransactionFactory* ftp_transaction_factory, |
| 716 net::FtpAuthCache* ftp_auth_cache) const { |
721 // NOTE(willchan): Keep these protocol handlers in sync with | 717 // NOTE(willchan): Keep these protocol handlers in sync with |
722 // ProfileIOData::IsHandledProtocol(). | 718 // ProfileIOData::IsHandledProtocol(). |
723 bool set_protocol = job_factory->SetProtocolHandler( | 719 bool set_protocol = job_factory->SetProtocolHandler( |
724 chrome::kFileScheme, new net::FileProtocolHandler()); | 720 chrome::kFileScheme, new net::FileProtocolHandler()); |
725 DCHECK(set_protocol); | 721 DCHECK(set_protocol); |
726 | 722 |
727 DCHECK(extension_info_map_); | 723 DCHECK(extension_info_map_); |
728 set_protocol = job_factory->SetProtocolHandler( | 724 set_protocol = job_factory->SetProtocolHandler( |
729 extensions::kExtensionScheme, | 725 extensions::kExtensionScheme, |
730 CreateExtensionProtocolHandler(is_incognito(), extension_info_map_)); | 726 CreateExtensionProtocolHandler(is_incognito(), extension_info_map_)); |
(...skipping 14 matching lines...) Expand all Loading... |
745 } | 741 } |
746 #endif // defined(OS_CHROMEOS) | 742 #endif // defined(OS_CHROMEOS) |
747 | 743 |
748 job_factory->SetProtocolHandler( | 744 job_factory->SetProtocolHandler( |
749 chrome::kAboutScheme, | 745 chrome::kAboutScheme, |
750 new chrome_browser_net::AboutProtocolHandler()); | 746 new chrome_browser_net::AboutProtocolHandler()); |
751 #if !defined(DISABLE_FTP_SUPPORT) | 747 #if !defined(DISABLE_FTP_SUPPORT) |
752 DCHECK(ftp_transaction_factory); | 748 DCHECK(ftp_transaction_factory); |
753 job_factory->SetProtocolHandler( | 749 job_factory->SetProtocolHandler( |
754 chrome::kFtpScheme, | 750 chrome::kFtpScheme, |
755 new net::FtpProtocolHandler(ftp_transaction_factory)); | 751 new net::FtpProtocolHandler(ftp_transaction_factory, |
| 752 ftp_auth_cache)); |
756 #endif // !defined(DISABLE_FTP_SUPPORT) | 753 #endif // !defined(DISABLE_FTP_SUPPORT) |
757 | 754 |
758 scoped_ptr<net::URLRequestJobFactory> top_job_factory = | 755 scoped_ptr<net::URLRequestJobFactory> top_job_factory = |
759 job_factory.PassAs<net::URLRequestJobFactory>(); | 756 job_factory.PassAs<net::URLRequestJobFactory>(); |
760 #if defined(DEBUG_DEVTOOLS) | 757 #if defined(DEBUG_DEVTOOLS) |
761 top_job_factory.reset(new net::ProtocolInterceptJobFactory( | 758 top_job_factory.reset(new net::ProtocolInterceptJobFactory( |
762 top_job_factory.Pass(), | 759 top_job_factory.Pass(), |
763 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 760 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
764 new DebugDevToolsInterceptor))); | 761 new DebugDevToolsInterceptor))); |
765 #endif | 762 #endif |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 void ProfileIOData::SetCookieSettingsForTesting( | 836 void ProfileIOData::SetCookieSettingsForTesting( |
840 CookieSettings* cookie_settings) { | 837 CookieSettings* cookie_settings) { |
841 DCHECK(!cookie_settings_.get()); | 838 DCHECK(!cookie_settings_.get()); |
842 cookie_settings_ = cookie_settings; | 839 cookie_settings_ = cookie_settings; |
843 } | 840 } |
844 | 841 |
845 void ProfileIOData::set_signin_names_for_testing( | 842 void ProfileIOData::set_signin_names_for_testing( |
846 SigninNamesOnIOThread* signin_names) { | 843 SigninNamesOnIOThread* signin_names) { |
847 signin_names_.reset(signin_names); | 844 signin_names_.reset(signin_names); |
848 } | 845 } |
OLD | NEW |