| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // static | 660 // static |
| 661 ProfileIOData* ProfileIOData::FromResourceContext( | 661 ProfileIOData* ProfileIOData::FromResourceContext( |
| 662 content::ResourceContext* rc) { | 662 content::ResourceContext* rc) { |
| 663 return (static_cast<ResourceContext*>(rc))->io_data_; | 663 return (static_cast<ResourceContext*>(rc))->io_data_; |
| 664 } | 664 } |
| 665 | 665 |
| 666 // static | 666 // static |
| 667 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { | 667 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { |
| 668 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); | 668 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); |
| 669 static const char* const kProtocolList[] = { | 669 static const char* const kProtocolList[] = { |
| 670 chrome::kFileScheme, | 670 content::kFileScheme, |
| 671 chrome::kChromeDevToolsScheme, | 671 chrome::kChromeDevToolsScheme, |
| 672 extensions::kExtensionScheme, | 672 extensions::kExtensionScheme, |
| 673 extensions::kExtensionResourceScheme, | 673 extensions::kExtensionResourceScheme, |
| 674 chrome::kChromeUIScheme, | 674 chrome::kChromeUIScheme, |
| 675 chrome::kDataScheme, | 675 chrome::kDataScheme, |
| 676 #if defined(OS_CHROMEOS) | 676 #if defined(OS_CHROMEOS) |
| 677 chrome::kDriveScheme, | 677 chrome::kDriveScheme, |
| 678 #endif // defined(OS_CHROMEOS) | 678 #endif // defined(OS_CHROMEOS) |
| 679 chrome::kAboutScheme, | 679 chrome::kAboutScheme, |
| 680 #if !defined(DISABLE_FTP_SUPPORT) | 680 #if !defined(DISABLE_FTP_SUPPORT) |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 | 1057 |
| 1058 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( | 1058 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( |
| 1059 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, | 1059 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, |
| 1060 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 1060 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 1061 protocol_handler_interceptor, | 1061 protocol_handler_interceptor, |
| 1062 net::NetworkDelegate* network_delegate, | 1062 net::NetworkDelegate* network_delegate, |
| 1063 net::FtpTransactionFactory* ftp_transaction_factory) const { | 1063 net::FtpTransactionFactory* ftp_transaction_factory) const { |
| 1064 // NOTE(willchan): Keep these protocol handlers in sync with | 1064 // NOTE(willchan): Keep these protocol handlers in sync with |
| 1065 // ProfileIOData::IsHandledProtocol(). | 1065 // ProfileIOData::IsHandledProtocol(). |
| 1066 bool set_protocol = job_factory->SetProtocolHandler( | 1066 bool set_protocol = job_factory->SetProtocolHandler( |
| 1067 chrome::kFileScheme, | 1067 content::kFileScheme, |
| 1068 new net::FileProtocolHandler( | 1068 new net::FileProtocolHandler( |
| 1069 content::BrowserThread::GetBlockingPool()-> | 1069 content::BrowserThread::GetBlockingPool()-> |
| 1070 GetTaskRunnerWithShutdownBehavior( | 1070 GetTaskRunnerWithShutdownBehavior( |
| 1071 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 1071 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| 1072 DCHECK(set_protocol); | 1072 DCHECK(set_protocol); |
| 1073 | 1073 |
| 1074 DCHECK(extension_info_map_.get()); | 1074 DCHECK(extension_info_map_.get()); |
| 1075 set_protocol = job_factory->SetProtocolHandler( | 1075 set_protocol = job_factory->SetProtocolHandler( |
| 1076 extensions::kExtensionScheme, | 1076 extensions::kExtensionScheme, |
| 1077 CreateExtensionProtocolHandler(is_incognito(), | 1077 CreateExtensionProtocolHandler(is_incognito(), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 void ProfileIOData::SetCookieSettingsForTesting( | 1192 void ProfileIOData::SetCookieSettingsForTesting( |
| 1193 CookieSettings* cookie_settings) { | 1193 CookieSettings* cookie_settings) { |
| 1194 DCHECK(!cookie_settings_.get()); | 1194 DCHECK(!cookie_settings_.get()); |
| 1195 cookie_settings_ = cookie_settings; | 1195 cookie_settings_ = cookie_settings; |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 void ProfileIOData::set_signin_names_for_testing( | 1198 void ProfileIOData::set_signin_names_for_testing( |
| 1199 SigninNamesOnIOThread* signin_names) { | 1199 SigninNamesOnIOThread* signin_names) { |
| 1200 signin_names_.reset(signin_names); | 1200 signin_names_.reset(signin_names); |
| 1201 } | 1201 } |
| OLD | NEW |