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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 return media_device_id_salt_->GetSalt(); | 884 return media_device_id_salt_->GetSalt(); |
885 } | 885 } |
886 | 886 |
887 bool ProfileIOData::IsOffTheRecord() const { | 887 bool ProfileIOData::IsOffTheRecord() const { |
888 return profile_type() == Profile::INCOGNITO_PROFILE | 888 return profile_type() == Profile::INCOGNITO_PROFILE |
889 || profile_type() == Profile::GUEST_PROFILE; | 889 || profile_type() == Profile::GUEST_PROFILE; |
890 } | 890 } |
891 | 891 |
892 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { | 892 void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { |
893 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 893 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
894 #if BUILDFLAG(ANDROID_JAVA_UI) | |
895 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion | |
896 // in crbugs.com/246495. | |
897 // Android has it's own preferences for metrics / crash uploading. | |
898 enable_metrics_.Init(prefs::kCrashReportingEnabled, | |
899 g_browser_process->local_state()); | |
900 enable_metrics_.MoveToThread( | |
901 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | |
902 #else | |
903 // Prep the PrefMember and send it to the IO thread, since this value will be | 894 // Prep the PrefMember and send it to the IO thread, since this value will be |
904 // read from there. | 895 // read from there. |
905 enable_metrics_.Init(metrics::prefs::kMetricsReportingEnabled, | 896 enable_metrics_.Init(metrics::prefs::kMetricsReportingEnabled, |
906 g_browser_process->local_state()); | 897 g_browser_process->local_state()); |
907 enable_metrics_.MoveToThread( | 898 enable_metrics_.MoveToThread( |
908 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 899 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
909 #endif // BUILDFLAG(ANDROID_JAVA_UI) | |
910 } | 900 } |
911 | 901 |
912 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { | 902 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { |
913 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 903 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
914 return enable_metrics_.GetValue(); | 904 return enable_metrics_.GetValue(); |
915 } | 905 } |
916 | 906 |
917 bool ProfileIOData::IsDataReductionProxyEnabled() const { | 907 bool ProfileIOData::IsDataReductionProxyEnabled() const { |
918 return data_reduction_proxy_io_data() && | 908 return data_reduction_proxy_io_data() && |
919 data_reduction_proxy_io_data()->IsEnabled(); | 909 data_reduction_proxy_io_data()->IsEnabled(); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 void ProfileIOData::SetCookieSettingsForTesting( | 1373 void ProfileIOData::SetCookieSettingsForTesting( |
1384 content_settings::CookieSettings* cookie_settings) { | 1374 content_settings::CookieSettings* cookie_settings) { |
1385 DCHECK(!cookie_settings_.get()); | 1375 DCHECK(!cookie_settings_.get()); |
1386 cookie_settings_ = cookie_settings; | 1376 cookie_settings_ = cookie_settings; |
1387 } | 1377 } |
1388 | 1378 |
1389 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1379 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
1390 const GURL& url) const { | 1380 const GURL& url) const { |
1391 return url_blacklist_manager_->GetURLBlacklistState(url); | 1381 return url_blacklist_manager_->GetURLBlacklistState(url); |
1392 } | 1382 } |
OLD | NEW |