| 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 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/browser/io_thread.h" | 35 #include "chrome/browser/io_thread.h" |
| 36 #include "chrome/browser/media/media_device_id_salt.h" | 36 #include "chrome/browser/media/media_device_id_salt.h" |
| 37 #include "chrome/browser/net/about_protocol_handler.h" | 37 #include "chrome/browser/net/about_protocol_handler.h" |
| 38 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 38 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| 39 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 39 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
| 40 #include "chrome/browser/net/chrome_net_log.h" | 40 #include "chrome/browser/net/chrome_net_log.h" |
| 41 #include "chrome/browser/net/chrome_network_delegate.h" | 41 #include "chrome/browser/net/chrome_network_delegate.h" |
| 42 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 42 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
| 43 #include "chrome/browser/net/cookie_store_util.h" | 43 #include "chrome/browser/net/cookie_store_util.h" |
| 44 #include "chrome/browser/net/proxy_service_factory.h" | 44 #include "chrome/browser/net/proxy_service_factory.h" |
| 45 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
| 45 #include "chrome/browser/profiles/profile.h" | 46 #include "chrome/browser/profiles/profile.h" |
| 46 #include "chrome/browser/profiles/profile_manager.h" | 47 #include "chrome/browser/profiles/profile_manager.h" |
| 47 #include "chrome/browser/signin/signin_names_io_thread.h" | 48 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 48 #include "chrome/common/chrome_paths.h" | 49 #include "chrome/common/chrome_paths.h" |
| 49 #include "chrome/common/chrome_switches.h" | 50 #include "chrome/common/chrome_switches.h" |
| 50 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
| 51 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
| 53 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se
rvice.h" |
| 54 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" |
| 55 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 56 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
| 52 #include "components/dom_distiller/core/url_constants.h" | 57 #include "components/dom_distiller/core/url_constants.h" |
| 53 #include "components/startup_metric_utils/startup_metric_utils.h" | 58 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 54 #include "components/sync_driver/pref_names.h" | 59 #include "components/sync_driver/pref_names.h" |
| 55 #include "components/url_fixer/url_fixer.h" | 60 #include "components/url_fixer/url_fixer.h" |
| 56 #include "content/public/browser/browser_thread.h" | 61 #include "content/public/browser/browser_thread.h" |
| 57 #include "content/public/browser/host_zoom_map.h" | 62 #include "content/public/browser/host_zoom_map.h" |
| 58 #include "content/public/browser/notification_service.h" | 63 #include "content/public/browser/notification_service.h" |
| 59 #include "content/public/browser/resource_context.h" | 64 #include "content/public/browser/resource_context.h" |
| 60 #include "net/base/keygen_handler.h" | 65 #include "net/base/keygen_handler.h" |
| 61 #include "net/cookies/canonical_cookie.h" | 66 #include "net/cookies/canonical_cookie.h" |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 846 |
| 842 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { | 847 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { |
| 843 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 844 #if defined(OS_CHROMEOS) | 849 #if defined(OS_CHROMEOS) |
| 845 return enable_metrics_; | 850 return enable_metrics_; |
| 846 #else | 851 #else |
| 847 return enable_metrics_.GetValue(); | 852 return enable_metrics_.GetValue(); |
| 848 #endif // defined(OS_CHROMEOS) | 853 #endif // defined(OS_CHROMEOS) |
| 849 } | 854 } |
| 850 | 855 |
| 851 #if defined(OS_ANDROID) | |
| 852 bool ProfileIOData::IsDataReductionProxyEnabled() const { | 856 bool ProfileIOData::IsDataReductionProxyEnabled() const { |
| 853 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 854 return data_reduction_proxy_enabled_.GetValue() || | 857 return data_reduction_proxy_enabled_.GetValue() || |
| 855 CommandLine::ForCurrentProcess()->HasSwitch( | 858 CommandLine::ForCurrentProcess()->HasSwitch( |
| 856 data_reduction_proxy::switches::kEnableDataReductionProxy); | 859 data_reduction_proxy::switches::kEnableDataReductionProxy); |
| 857 #else | |
| 858 return false; | |
| 859 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 860 } | 860 } |
| 861 #endif | |
| 862 | 861 |
| 863 base::WeakPtr<net::HttpServerProperties> | 862 base::WeakPtr<net::HttpServerProperties> |
| 864 ProfileIOData::http_server_properties() const { | 863 ProfileIOData::http_server_properties() const { |
| 865 return http_server_properties_->GetWeakPtr(); | 864 return http_server_properties_->GetWeakPtr(); |
| 866 } | 865 } |
| 867 | 866 |
| 868 void ProfileIOData::set_http_server_properties( | 867 void ProfileIOData::set_http_server_properties( |
| 869 scoped_ptr<net::HttpServerProperties> http_server_properties) const { | 868 scoped_ptr<net::HttpServerProperties> http_server_properties) const { |
| 870 http_server_properties_ = http_server_properties.Pass(); | 869 http_server_properties_ = http_server_properties.Pass(); |
| 871 } | 870 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 profile_params_->extension_info_map.get()); | 1006 profile_params_->extension_info_map.get()); |
| 1008 #endif | 1007 #endif |
| 1009 #if defined(ENABLE_CONFIGURATION_POLICY) | 1008 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 1010 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); | 1009 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); |
| 1011 #endif | 1010 #endif |
| 1012 network_delegate->set_profile(profile_params_->profile); | 1011 network_delegate->set_profile(profile_params_->profile); |
| 1013 network_delegate->set_profile_path(profile_params_->path); | 1012 network_delegate->set_profile_path(profile_params_->path); |
| 1014 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); | 1013 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); |
| 1015 network_delegate->set_enable_do_not_track(&enable_do_not_track_); | 1014 network_delegate->set_enable_do_not_track(&enable_do_not_track_); |
| 1016 network_delegate->set_force_google_safe_search(&force_safesearch_); | 1015 network_delegate->set_force_google_safe_search(&force_safesearch_); |
| 1017 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 1018 network_delegate->set_data_reduction_proxy_enabled_pref( | 1016 network_delegate->set_data_reduction_proxy_enabled_pref( |
| 1019 &data_reduction_proxy_enabled_); | 1017 &data_reduction_proxy_enabled_); |
| 1020 #endif | |
| 1021 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); | 1018 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); |
| 1022 network_delegate_.reset(network_delegate); | 1019 network_delegate_.reset(network_delegate); |
| 1023 | 1020 |
| 1024 fraudulent_certificate_reporter_.reset( | 1021 fraudulent_certificate_reporter_.reset( |
| 1025 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 1022 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
| 1026 main_request_context_.get())); | 1023 main_request_context_.get())); |
| 1027 | 1024 |
| 1028 // NOTE: Proxy service uses the default io thread network delegate, not the | 1025 // NOTE: Proxy service uses the default io thread network delegate, not the |
| 1029 // delegate just created. | 1026 // delegate just created. |
| 1030 proxy_service_.reset( | 1027 proxy_service_.reset( |
| 1031 ProxyServiceFactory::CreateProxyService( | 1028 ProxyServiceFactory::CreateProxyService( |
| 1032 io_thread->net_log(), | 1029 io_thread->net_log(), |
| 1033 io_thread_globals->proxy_script_fetcher_context.get(), | 1030 io_thread_globals->proxy_script_fetcher_context.get(), |
| 1034 io_thread_globals->system_network_delegate.get(), | 1031 io_thread_globals->system_network_delegate.get(), |
| 1035 profile_params_->proxy_config_service.release(), | 1032 profile_params_->proxy_config_service.release(), |
| 1036 command_line, | 1033 command_line, |
| 1037 quick_check_enabled_.GetValue())); | 1034 quick_check_enabled_.GetValue())); |
| 1038 | |
| 1039 transport_security_state_.reset(new net::TransportSecurityState()); | 1035 transport_security_state_.reset(new net::TransportSecurityState()); |
| 1040 transport_security_persister_.reset( | 1036 transport_security_persister_.reset( |
| 1041 new net::TransportSecurityPersister( | 1037 new net::TransportSecurityPersister( |
| 1042 transport_security_state_.get(), | 1038 transport_security_state_.get(), |
| 1043 profile_params_->path, | 1039 profile_params_->path, |
| 1044 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 1040 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 1045 IsOffTheRecord())); | 1041 IsOffTheRecord())); |
| 1046 | 1042 |
| 1047 // Take ownership over these parameters. | 1043 // Take ownership over these parameters. |
| 1048 cookie_settings_ = profile_params_->cookie_settings; | 1044 cookie_settings_ = profile_params_->cookie_settings; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 google_services_username_pattern_.Destroy(); | 1180 google_services_username_pattern_.Destroy(); |
| 1185 reverse_autologin_enabled_.Destroy(); | 1181 reverse_autologin_enabled_.Destroy(); |
| 1186 one_click_signin_rejected_email_list_.Destroy(); | 1182 one_click_signin_rejected_email_list_.Destroy(); |
| 1187 enable_referrers_.Destroy(); | 1183 enable_referrers_.Destroy(); |
| 1188 enable_do_not_track_.Destroy(); | 1184 enable_do_not_track_.Destroy(); |
| 1189 force_safesearch_.Destroy(); | 1185 force_safesearch_.Destroy(); |
| 1190 #if !defined(OS_CHROMEOS) | 1186 #if !defined(OS_CHROMEOS) |
| 1191 enable_metrics_.Destroy(); | 1187 enable_metrics_.Destroy(); |
| 1192 #endif | 1188 #endif |
| 1193 safe_browsing_enabled_.Destroy(); | 1189 safe_browsing_enabled_.Destroy(); |
| 1194 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 1195 data_reduction_proxy_enabled_.Destroy(); | 1190 data_reduction_proxy_enabled_.Destroy(); |
| 1196 #endif | |
| 1197 printing_enabled_.Destroy(); | 1191 printing_enabled_.Destroy(); |
| 1198 sync_disabled_.Destroy(); | 1192 sync_disabled_.Destroy(); |
| 1199 signin_allowed_.Destroy(); | 1193 signin_allowed_.Destroy(); |
| 1200 network_prediction_options_.Destroy(); | 1194 network_prediction_options_.Destroy(); |
| 1201 quick_check_enabled_.Destroy(); | 1195 quick_check_enabled_.Destroy(); |
| 1202 if (media_device_id_salt_.get()) | 1196 if (media_device_id_salt_.get()) |
| 1203 media_device_id_salt_->ShutdownOnUIThread(); | 1197 media_device_id_salt_->ShutdownOnUIThread(); |
| 1204 session_startup_pref_.Destroy(); | 1198 session_startup_pref_.Destroy(); |
| 1205 #if defined(ENABLE_CONFIGURATION_POLICY) | 1199 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 1206 if (url_blacklist_manager_) | 1200 if (url_blacklist_manager_) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 void ProfileIOData::SetCookieSettingsForTesting( | 1270 void ProfileIOData::SetCookieSettingsForTesting( |
| 1277 CookieSettings* cookie_settings) { | 1271 CookieSettings* cookie_settings) { |
| 1278 DCHECK(!cookie_settings_.get()); | 1272 DCHECK(!cookie_settings_.get()); |
| 1279 cookie_settings_ = cookie_settings; | 1273 cookie_settings_ = cookie_settings; |
| 1280 } | 1274 } |
| 1281 | 1275 |
| 1282 void ProfileIOData::set_signin_names_for_testing( | 1276 void ProfileIOData::set_signin_names_for_testing( |
| 1283 SigninNamesOnIOThread* signin_names) { | 1277 SigninNamesOnIOThread* signin_names) { |
| 1284 signin_names_.reset(signin_names); | 1278 signin_names_.reset(signin_names); |
| 1285 } | 1279 } |
| OLD | NEW |