| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 } | 601 } |
| 602 | 602 |
| 603 void ProfileIOData::ApplyProfileParamsToContext( | 603 void ProfileIOData::ApplyProfileParamsToContext( |
| 604 ChromeURLRequestContext* context) const { | 604 ChromeURLRequestContext* context) const { |
| 605 context->set_is_incognito(is_incognito()); | 605 context->set_is_incognito(is_incognito()); |
| 606 context->set_http_user_agent_settings( | 606 context->set_http_user_agent_settings( |
| 607 chrome_http_user_agent_settings_.get()); | 607 chrome_http_user_agent_settings_.get()); |
| 608 context->set_ssl_config_service(profile_params_->ssl_config_service); | 608 context->set_ssl_config_service(profile_params_->ssl_config_service); |
| 609 } | 609 } |
| 610 | 610 |
| 611 void ProfileIOData::SetUpJobFactoryDefaults( | 611 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( |
| 612 net::URLRequestJobFactoryImpl* job_factory, | 612 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, |
| 613 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 613 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 614 protocol_handler_interceptor, | 614 protocol_handler_interceptor, |
| 615 net::NetworkDelegate* network_delegate, | 615 net::NetworkDelegate* network_delegate, |
| 616 net::FtpTransactionFactory* ftp_transaction_factory, | 616 net::FtpTransactionFactory* ftp_transaction_factory, |
| 617 net::FtpAuthCache* ftp_auth_cache) const { | 617 net::FtpAuthCache* ftp_auth_cache) const { |
| 618 // NOTE(willchan): Keep these protocol handlers in sync with | 618 // NOTE(willchan): Keep these protocol handlers in sync with |
| 619 // ProfileIOData::IsHandledProtocol(). | 619 // ProfileIOData::IsHandledProtocol(). |
| 620 bool set_protocol = job_factory->SetProtocolHandler( | 620 bool set_protocol = job_factory->SetProtocolHandler( |
| 621 chrome::kFileScheme, new net::FileProtocolHandler()); | 621 chrome::kFileScheme, new net::FileProtocolHandler()); |
| 622 DCHECK(set_protocol); | 622 DCHECK(set_protocol); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 job_factory->SetProtocolHandler( | 665 job_factory->SetProtocolHandler( |
| 666 chrome::kAboutScheme, | 666 chrome::kAboutScheme, |
| 667 new chrome_browser_net::AboutProtocolHandler()); | 667 new chrome_browser_net::AboutProtocolHandler()); |
| 668 #if !defined(DISABLE_FTP_SUPPORT) | 668 #if !defined(DISABLE_FTP_SUPPORT) |
| 669 DCHECK(ftp_transaction_factory); | 669 DCHECK(ftp_transaction_factory); |
| 670 job_factory->SetProtocolHandler( | 670 job_factory->SetProtocolHandler( |
| 671 chrome::kFtpScheme, | 671 chrome::kFtpScheme, |
| 672 new net::FtpProtocolHandler(ftp_transaction_factory, | 672 new net::FtpProtocolHandler(ftp_transaction_factory, |
| 673 ftp_auth_cache)); | 673 ftp_auth_cache)); |
| 674 #endif // !defined(DISABLE_FTP_SUPPORT) | 674 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 675 return job_factory.PassAs<net::URLRequestJobFactory>(); |
| 675 } | 676 } |
| 676 | 677 |
| 677 void ProfileIOData::ShutdownOnUIThread() { | 678 void ProfileIOData::ShutdownOnUIThread() { |
| 678 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 679 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 679 | 680 |
| 680 if (signin_names_) | 681 if (signin_names_) |
| 681 signin_names_->ReleaseResourcesOnUIThread(); | 682 signin_names_->ReleaseResourcesOnUIThread(); |
| 682 | 683 |
| 683 google_services_username_.Destroy(); | 684 google_services_username_.Destroy(); |
| 684 google_services_username_pattern_.Destroy(); | 685 google_services_username_pattern_.Destroy(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 void ProfileIOData::SetCookieSettingsForTesting( | 750 void ProfileIOData::SetCookieSettingsForTesting( |
| 750 CookieSettings* cookie_settings) { | 751 CookieSettings* cookie_settings) { |
| 751 DCHECK(!cookie_settings_.get()); | 752 DCHECK(!cookie_settings_.get()); |
| 752 cookie_settings_ = cookie_settings; | 753 cookie_settings_ = cookie_settings; |
| 753 } | 754 } |
| 754 | 755 |
| 755 void ProfileIOData::set_signin_names_for_testing( | 756 void ProfileIOData::set_signin_names_for_testing( |
| 756 SigninNamesOnIOThread* signin_names) { | 757 SigninNamesOnIOThread* signin_names) { |
| 757 signin_names_.reset(signin_names); | 758 signin_names_.reset(signin_names); |
| 758 } | 759 } |
| OLD | NEW |