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

Unified Diff: chrome/browser/metrics/metrics_reporting_state.h

Issue 506663003: Consolidates accessing and setting the UMA pref to be within metrics code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/metrics/metrics_reporting_state.h
diff --git a/chrome/browser/metrics/metrics_reporting_state.h b/chrome/browser/metrics/metrics_reporting_state.h
index c333d84e52b87cfbe39697c3be71c829659838a2..0ae58b5938191b92d32f76cd2e7f35ba551fcdd4 100644
--- a/chrome/browser/metrics/metrics_reporting_state.h
+++ b/chrome/browser/metrics/metrics_reporting_state.h
@@ -5,12 +5,20 @@
#ifndef CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
#define CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
-// Tries to set crash stats upload consent to |enabled|. Regardless of success,
-// if crash stats uploading is enabled, starts the MetricsService; otherwise
-// stops it.
-// Returns whether crash stats uploading is enabled.
-// TODO(tfarina): This method is pretty confusing. Clean this up and rename it
-// to something that makes more sense.
-bool ResolveMetricsReportingEnabled(bool enabled);
+#include "base/callback.h"
+#include "components/metrics/metrics_service.h"
+
+// Tries to set crash stats upload consent to |enabled|.
+bool SetGoogleUpdateSettings(bool enabled);
Alexei Svitkine (slow) 2014/08/28 14:46:48 Functions that are only called internally by the .
gayane -on leave until 09-2017 2014/09/03 20:20:08 Done.
+
+// Does the necessary changes for MetricsReportingEnabled changes which needs
+// to be done in the main thread.
+void SetMetricsReporting(base::Callback<void(bool)> callback_fn,
+ bool enabled, bool success);
+
+// Calls |SetGoogleUpdateSettings| function in FILE thread with a callback
+// |SetMetricsReporting| function which does the remaining necessary changes.
+void InitiateMetricsReportingChange(
+ base::Callback<void(bool)> callback_fn, bool enabled);
#endif // CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_

Powered by Google App Engine
This is Rietveld 408576698