| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 sync_disabled_.MoveToThread(io_task_runner); | 497 sync_disabled_.MoveToThread(io_task_runner); |
| 498 | 498 |
| 499 signin_allowed_.Init(prefs::kSigninAllowed, pref_service); | 499 signin_allowed_.Init(prefs::kSigninAllowed, pref_service); |
| 500 signin_allowed_.MoveToThread(io_task_runner); | 500 signin_allowed_.MoveToThread(io_task_runner); |
| 501 } | 501 } |
| 502 | 502 |
| 503 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, | 503 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, |
| 504 local_state_pref_service); | 504 local_state_pref_service); |
| 505 quick_check_enabled_.MoveToThread(io_task_runner); | 505 quick_check_enabled_.MoveToThread(io_task_runner); |
| 506 | 506 |
| 507 media_device_id_salt_ = new MediaDeviceIDSalt(pref_service, IsOffTheRecord()); | 507 if (!IsOffTheRecord()) |
| 508 media_device_id_salt_ = new MediaDeviceIDSalt(pref_service); |
| 508 | 509 |
| 509 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, | 510 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, |
| 510 pref_service); | 511 pref_service); |
| 511 | 512 |
| 512 network_prediction_options_.MoveToThread(io_task_runner); | 513 network_prediction_options_.MoveToThread(io_task_runner); |
| 513 | 514 |
| 514 #if defined(OS_CHROMEOS) | 515 #if defined(OS_CHROMEOS) |
| 515 std::unique_ptr<policy::PolicyCertVerifier> verifier = | 516 std::unique_ptr<policy::PolicyCertVerifier> verifier = |
| 516 policy::PolicyCertServiceFactory::CreateForProfile(profile); | 517 policy::PolicyCertServiceFactory::CreateForProfile(profile); |
| 517 policy_cert_verifier_ = verifier.get(); | 518 policy_cert_verifier_ = verifier.get(); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 DCHECK(initialized_ || cookie_settings_.get()); | 865 DCHECK(initialized_ || cookie_settings_.get()); |
| 865 return cookie_settings_.get(); | 866 return cookie_settings_.get(); |
| 866 } | 867 } |
| 867 | 868 |
| 868 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { | 869 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { |
| 869 DCHECK(initialized_); | 870 DCHECK(initialized_); |
| 870 return host_content_settings_map_.get(); | 871 return host_content_settings_map_.get(); |
| 871 } | 872 } |
| 872 | 873 |
| 873 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const { | 874 ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const { |
| 875 DCHECK(media_device_id_salt_); |
| 874 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_); | 876 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_); |
| 875 } | 877 } |
| 876 | 878 |
| 877 bool ProfileIOData::IsOffTheRecord() const { | 879 bool ProfileIOData::IsOffTheRecord() const { |
| 878 return profile_type() == Profile::INCOGNITO_PROFILE | 880 return profile_type() == Profile::INCOGNITO_PROFILE |
| 879 || profile_type() == Profile::GUEST_PROFILE; | 881 || profile_type() == Profile::GUEST_PROFILE; |
| 880 } | 882 } |
| 881 | 883 |
| 882 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { | 884 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { |
| 883 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 885 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 this, | 1005 this, |
| 1004 got_delegate_callback); | 1006 got_delegate_callback); |
| 1005 #else | 1007 #else |
| 1006 callback.Run(base::WrapUnique( | 1008 callback.Run(base::WrapUnique( |
| 1007 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); | 1009 new net::KeygenHandler(key_size_in_bits, challenge_string, url))); |
| 1008 #endif | 1010 #endif |
| 1009 } | 1011 } |
| 1010 | 1012 |
| 1011 ResourceContext::SaltCallback | 1013 ResourceContext::SaltCallback |
| 1012 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { | 1014 ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { |
| 1013 return io_data_->GetMediaDeviceIDSalt(); | 1015 if (io_data_->HasMediaDeviceIDSalt()) |
| 1016 return io_data_->GetMediaDeviceIDSalt(); |
| 1017 |
| 1018 return content::ResourceContext::GetMediaDeviceIDSalt(); |
| 1014 } | 1019 } |
| 1015 | 1020 |
| 1016 void ProfileIOData::Init( | 1021 void ProfileIOData::Init( |
| 1017 content::ProtocolHandlerMap* protocol_handlers, | 1022 content::ProtocolHandlerMap* protocol_handlers, |
| 1018 content::URLRequestInterceptorScopedVector request_interceptors) const { | 1023 content::URLRequestInterceptorScopedVector request_interceptors) const { |
| 1019 // The basic logic is implemented here. The specific initialization | 1024 // The basic logic is implemented here. The specific initialization |
| 1020 // is done in InitializeInternal(), implemented by subtypes. Static helper | 1025 // is done in InitializeInternal(), implemented by subtypes. Static helper |
| 1021 // functions have been provided to assist in common operations. | 1026 // functions have been provided to assist in common operations. |
| 1022 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1027 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1023 DCHECK(!initialized_); | 1028 DCHECK(!initialized_); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 void ProfileIOData::SetCookieSettingsForTesting( | 1366 void ProfileIOData::SetCookieSettingsForTesting( |
| 1362 content_settings::CookieSettings* cookie_settings) { | 1367 content_settings::CookieSettings* cookie_settings) { |
| 1363 DCHECK(!cookie_settings_.get()); | 1368 DCHECK(!cookie_settings_.get()); |
| 1364 cookie_settings_ = cookie_settings; | 1369 cookie_settings_ = cookie_settings; |
| 1365 } | 1370 } |
| 1366 | 1371 |
| 1367 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1372 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
| 1368 const GURL& url) const { | 1373 const GURL& url) const { |
| 1369 return url_blacklist_manager_->GetURLBlacklistState(url); | 1374 return url_blacklist_manager_->GetURLBlacklistState(url); |
| 1370 } | 1375 } |
| OLD | NEW |