Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1411863002: Use kMetricsReportingEnabled instead of kStatsReporingPref on metrics side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 010d0cbeec7af03358db7dd5723bf48f70341f0d..e4da99171bc603072de2a6b6c7ff90508160ab51 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -62,6 +62,7 @@
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/memory/tab_manager.h"
#include "chrome/browser/metrics/field_trial_synchronizer.h"
+#include "chrome/browser/metrics/metrics_reporting_state.h"
#include "chrome/browser/metrics/thread_watcher.h"
#include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
#include "chrome/browser/net/crl_set_fetcher.h"
@@ -732,6 +733,16 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() {
// Register a synthetic field trial for the sampling profiler configuration
// that was already chosen.
sampling_profiler_config_.RegisterSyntheticFieldTrial();
+
+#if defined(OS_CHROMEOS)
+ // Set kMetricsReportingEnabled based on kStatsReportingPref device setting as
+ // it is more reliable for Chrome OS.
Mattias Nissler (ping if slow) 2015/10/28 09:51:15 suggestion: s/it is more reliable for Chrome OS/it
gayane -on leave until 09-2017 2015/10/28 15:00:07 Done.
+ bool enable_metrics = false;
+ chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
+ &enable_metrics);
Mattias Nissler (ping if slow) 2015/10/28 09:51:15 I'd expect an observer to be installed here to re-
gayane -on leave until 09-2017 2015/10/28 15:00:06 you mean besides initialization? My understanding
Mattias Nissler (ping if slow) 2015/10/29 10:06:14 I guess you're referring to the CrosSettings::SetB
Alexei Svitkine (slow) 2015/10/29 17:04:14 Can the observer change be done in a later CL? I t
Mattias Nissler (ping if slow) 2015/11/02 11:09:58 Note that the old code does handle device settings
+ InitiateMetricsReportingChange(enable_metrics,
+ OnMetricsReportingCallbackType());
+#endif
}
// ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related --------------

Powered by Google App Engine
This is Rietveld 408576698