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

Unified Diff: chrome/browser/android/metrics/uma_session_stats.cc

Issue 2248793002: Remove OnRecordingDisabled() metrics client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add helper function Created 4 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/android/metrics/uma_session_stats.cc
diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc
index be0a0ded2608b5be048b8482d6c9f6d8b02c495e..dc18ab5fe40cead9795a7b5d51f855cddf02fc07 100644
--- a/chrome/browser/android/metrics/uma_session_stats.cc
+++ b/chrome/browser/android/metrics/uma_session_stats.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/crash_keys.h"
gayane -on leave until 09-2017 2016/08/17 15:57:54 need this?
Alexei Svitkine (slow) 2016/08/17 16:26:38 Nope. Removed!
#include "chrome/common/pref_names.h"
#include "chrome/installer/util/google_update_settings.h"
#include "components/metrics/metrics_pref_names.h"
@@ -108,6 +109,8 @@ static void UpdateMetricsServiceState(JNIEnv* env,
DCHECK(metrics);
if (metrics->recording_active() != may_record) {
+ UpdateMetricsPrefsOnPermissionChange(may_record);
+
// This function puts a consent file with the ClientID in the
// data directory. The ID is passed to the renderer for crash
// reporting when things go wrong.
@@ -117,17 +120,6 @@ static void UpdateMetricsServiceState(JNIEnv* env,
may_record));
}
- // Clear the client id pref when opting out. Note: Mirrors code in
- // metrics_reporting_state.cc. TODO(asvitkine): Unify.
- if (!may_record) {
- // Note: Clearing client id will not affect the running state (e.g. field
- // trial randomization), as the pref is only read on startup.
- g_browser_process->local_state()->ClearPref(
- metrics::prefs::kMetricsClientID);
- g_browser_process->local_state()->ClearPref(
- metrics::prefs::kMetricsReportingEnabledTimestamp);
- }
-
g_browser_process->GetMetricsServicesManager()->UpdatePermissions(
may_record, may_upload);
}

Powered by Google App Engine
This is Rietveld 408576698