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

Unified Diff: chrome/browser/metrics/chrome_metrics_service_accessor.cc

Issue 2302823003: Only report PasswordState in Sync for UMA+non-custom passphrase users. (Closed)
Patch Set: Created 4 years, 3 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/chrome_metrics_service_accessor.cc
diff --git a/chrome/browser/metrics/chrome_metrics_service_accessor.cc b/chrome/browser/metrics/chrome_metrics_service_accessor.cc
index cd8e07148a694059c084a6a839aba95713955490..191425ae0a6f26f94653585a7011d91612c57d80 100644
--- a/chrome/browser/metrics/chrome_metrics_service_accessor.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_accessor.cc
@@ -15,8 +15,26 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#endif
+namespace {
+
+const bool* gMetricsAndCrashReportingForTesting = nullptr;
Alexei Svitkine (slow) 2016/09/02 18:05:45 Nit: Incorrect naming convention. We only use kFo
Nathan Parker 2016/09/02 22:42:36 Done.
+
+} // namespace
+
+// static
+void ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(
+ const bool* value) {
+ DCHECK_NE(gMetricsAndCrashReportingForTesting == nullptr, value == nullptr)
+ << "Unpaired set/reset";
+
+ gMetricsAndCrashReportingForTesting = value;
+}
+
// static
bool ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled() {
+ if (gMetricsAndCrashReportingForTesting)
+ return *gMetricsAndCrashReportingForTesting;
+
// TODO(blundell): Fix the unittests that don't set up the UI thread and
// change this to just be DCHECK_CURRENTLY_ON().
DCHECK(

Powered by Google App Engine
This is Rietveld 408576698