| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 | 609 |
| 610 void ProfileIOData::ApplyProfileParamsToContext( | 610 void ProfileIOData::ApplyProfileParamsToContext( |
| 611 ChromeURLRequestContext* context) const { | 611 ChromeURLRequestContext* context) const { |
| 612 context->set_is_incognito(is_incognito()); | 612 context->set_is_incognito(is_incognito()); |
| 613 context->set_http_user_agent_settings( | 613 context->set_http_user_agent_settings( |
| 614 chrome_http_user_agent_settings_.get()); | 614 chrome_http_user_agent_settings_.get()); |
| 615 context->set_ssl_config_service(profile_params_->ssl_config_service); | 615 context->set_ssl_config_service(profile_params_->ssl_config_service); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void ProfileIOData::SetUpJobFactoryDefaults( | 618 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( |
| 619 net::URLRequestJobFactoryImpl* job_factory, | 619 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, |
| 620 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 620 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 621 protocol_handler_interceptor, | 621 protocol_handler_interceptor, |
| 622 net::NetworkDelegate* network_delegate, | 622 net::NetworkDelegate* network_delegate, |
| 623 net::FtpTransactionFactory* ftp_transaction_factory, | 623 net::FtpTransactionFactory* ftp_transaction_factory, |
| 624 net::FtpAuthCache* ftp_auth_cache) const { | 624 net::FtpAuthCache* ftp_auth_cache) const { |
| 625 // NOTE(willchan): Keep these protocol handlers in sync with | 625 // NOTE(willchan): Keep these protocol handlers in sync with |
| 626 // ProfileIOData::IsHandledProtocol(). | 626 // ProfileIOData::IsHandledProtocol(). |
| 627 bool set_protocol = job_factory->SetProtocolHandler( | 627 bool set_protocol = job_factory->SetProtocolHandler( |
| 628 chrome::kFileScheme, new net::FileProtocolHandler()); | 628 chrome::kFileScheme, new net::FileProtocolHandler()); |
| 629 DCHECK(set_protocol); | 629 DCHECK(set_protocol); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 job_factory->SetProtocolHandler( | 672 job_factory->SetProtocolHandler( |
| 673 chrome::kAboutScheme, | 673 chrome::kAboutScheme, |
| 674 new chrome_browser_net::AboutProtocolHandler()); | 674 new chrome_browser_net::AboutProtocolHandler()); |
| 675 #if !defined(DISABLE_FTP_SUPPORT) | 675 #if !defined(DISABLE_FTP_SUPPORT) |
| 676 DCHECK(ftp_transaction_factory); | 676 DCHECK(ftp_transaction_factory); |
| 677 job_factory->SetProtocolHandler( | 677 job_factory->SetProtocolHandler( |
| 678 chrome::kFtpScheme, | 678 chrome::kFtpScheme, |
| 679 new net::FtpProtocolHandler(ftp_transaction_factory, | 679 new net::FtpProtocolHandler(ftp_transaction_factory, |
| 680 ftp_auth_cache)); | 680 ftp_auth_cache)); |
| 681 #endif // !defined(DISABLE_FTP_SUPPORT) | 681 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 682 return job_factory.PassAs<net::URLRequestJobFactory>(); |
| 682 } | 683 } |
| 683 | 684 |
| 684 void ProfileIOData::ShutdownOnUIThread() { | 685 void ProfileIOData::ShutdownOnUIThread() { |
| 685 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 686 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 686 | 687 |
| 687 if (signin_names_) | 688 if (signin_names_) |
| 688 signin_names_->ReleaseResourcesOnUIThread(); | 689 signin_names_->ReleaseResourcesOnUIThread(); |
| 689 | 690 |
| 690 google_services_username_.Destroy(); | 691 google_services_username_.Destroy(); |
| 691 google_services_username_pattern_.Destroy(); | 692 google_services_username_pattern_.Destroy(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 void ProfileIOData::SetCookieSettingsForTesting( | 757 void ProfileIOData::SetCookieSettingsForTesting( |
| 757 CookieSettings* cookie_settings) { | 758 CookieSettings* cookie_settings) { |
| 758 DCHECK(!cookie_settings_.get()); | 759 DCHECK(!cookie_settings_.get()); |
| 759 cookie_settings_ = cookie_settings; | 760 cookie_settings_ = cookie_settings; |
| 760 } | 761 } |
| 761 | 762 |
| 762 void ProfileIOData::set_signin_names_for_testing( | 763 void ProfileIOData::set_signin_names_for_testing( |
| 763 SigninNamesOnIOThread* signin_names) { | 764 SigninNamesOnIOThread* signin_names) { |
| 764 signin_names_.reset(signin_names); | 765 signin_names_.reset(signin_names); |
| 765 } | 766 } |
| OLD | NEW |