Chromium Code Reviews| Index: chrome/browser/metrics/metrics_reporting_state.cc |
| diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/metrics/metrics_reporting_state.cc |
| index 9e74f158f3c558422940129dbb06ffa5a7aaa118..1b748a6ac32d765028873f23f51b2f43bb637299 100644 |
| --- a/chrome/browser/metrics/metrics_reporting_state.cc |
| +++ b/chrome/browser/metrics/metrics_reporting_state.cc |
| @@ -13,6 +13,7 @@ |
| #include "chrome/installer/util/google_update_settings.h" |
| #include "components/metrics/metrics_pref_names.h" |
| #include "components/metrics/metrics_service.h" |
| +#include "components/metrics_services_manager/metrics_services_manager.h" |
| #include "components/prefs/pref_registry_simple.h" |
| #include "components/prefs/pref_service.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -60,18 +61,15 @@ void SetMetricsReporting(bool to_update_pref, |
| const OnMetricsReportingCallbackType& callback_fn, |
| bool updated_pref) { |
| metrics::MetricsService* metrics = g_browser_process->metrics_service(); |
| - if (metrics) { |
| - if (updated_pref) |
| - metrics->Start(); |
| - else |
| - metrics->Stop(); |
| - } |
| #if !defined(OS_ANDROID) |
| g_browser_process->local_state()->SetBoolean( |
| metrics::prefs::kMetricsReportingEnabled, updated_pref); |
| #endif // !defined(OS_ANDROID) |
| + // Uses the current state of whether reporting is enabled to enabled services. |
| + g_browser_process->GetMetricsServicesManager()->UpdateUploadPermissions(true); |
|
Alexei Svitkine (slow)
2016/07/19 15:23:59
Shouldn't this be updated_pref value and not |true
jwd
2016/07/19 21:21:49
No, the true refers to the "can upload" permission
|
| + |
| // When a user opts in to the metrics reporting service, the previously |
| // collected data should be cleared to ensure that nothing is reported before |
| // a user opts in and all reported data is accurate. |