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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 835 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
836 #if defined(OS_CHROMEOS) | 836 #if defined(OS_CHROMEOS) |
837 // Just fetch the value from ChromeOS' settings while we're on the UI thread. | 837 // Just fetch the value from ChromeOS' settings while we're on the UI thread. |
838 // TODO(stevet): For now, this value is only set on profile initialization. | 838 // TODO(stevet): For now, this value is only set on profile initialization. |
839 // We will want to do something similar to the PrefMember method below in the | 839 // We will want to do something similar to the PrefMember method below in the |
840 // future to more accurately capture this state. | 840 // future to more accurately capture this state. |
841 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, | 841 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, |
842 &enable_metrics_); | 842 &enable_metrics_); |
843 #elif defined(OS_ANDROID) | 843 #elif defined(OS_ANDROID) |
844 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion | 844 // TODO(dwkang): rename or unify the pref for UMA once we have conclusion |
845 // in crbugs.com/246495. | 845 // in crbug.com/246495. |
846 // Android has it's own preferences for metrics / crash uploading. | 846 // Android has it's own preferences for metrics / crash uploading. |
847 enable_metrics_.Init(prefs::kCrashReportingEnabled, | 847 enable_metrics_.Init(prefs::kCrashReportingEnabled, |
848 g_browser_process->local_state()); | 848 g_browser_process->local_state()); |
| 849 enable_metrics_.Init(prefs::kMetricsReportingEnabled, |
| 850 g_browser_process->local_state()); |
849 enable_metrics_.MoveToThread( | 851 enable_metrics_.MoveToThread( |
850 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 852 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
851 #else | 853 #else |
852 // Prep the PrefMember and send it to the IO thread, since this value will be | 854 // Prep the PrefMember and send it to the IO thread, since this value will be |
853 // read from there. | 855 // read from there. |
854 enable_metrics_.Init(prefs::kMetricsReportingEnabled, | 856 enable_metrics_.Init(prefs::kMetricsReportingEnabled, |
855 g_browser_process->local_state()); | 857 g_browser_process->local_state()); |
856 enable_metrics_.MoveToThread( | 858 enable_metrics_.MoveToThread( |
857 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 859 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
858 #endif // defined(OS_CHROMEOS) | 860 #endif // defined(OS_CHROMEOS) |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 void ProfileIOData::SetCookieSettingsForTesting( | 1299 void ProfileIOData::SetCookieSettingsForTesting( |
1298 CookieSettings* cookie_settings) { | 1300 CookieSettings* cookie_settings) { |
1299 DCHECK(!cookie_settings_.get()); | 1301 DCHECK(!cookie_settings_.get()); |
1300 cookie_settings_ = cookie_settings; | 1302 cookie_settings_ = cookie_settings; |
1301 } | 1303 } |
1302 | 1304 |
1303 void ProfileIOData::set_signin_names_for_testing( | 1305 void ProfileIOData::set_signin_names_for_testing( |
1304 SigninNamesOnIOThread* signin_names) { | 1306 SigninNamesOnIOThread* signin_names) { |
1305 signin_names_.reset(signin_names); | 1307 signin_names_.reset(signin_names); |
1306 } | 1308 } |
OLD | NEW |