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

Side by Side Diff: components/metrics/metrics_state_manager.cc

Issue 1537743006: Persist setup metrics and have Chrome report them during UMA upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/metrics/metrics_state_manager.h" 5 #include "components/metrics/metrics_state_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return result.Pass(); 193 return result.Pass();
194 } 194 }
195 195
196 // static 196 // static
197 void MetricsStateManager::RegisterPrefs(PrefRegistrySimple* registry) { 197 void MetricsStateManager::RegisterPrefs(PrefRegistrySimple* registry) {
198 registry->RegisterBooleanPref(prefs::kMetricsResetIds, false); 198 registry->RegisterBooleanPref(prefs::kMetricsResetIds, false);
199 registry->RegisterStringPref(prefs::kMetricsClientID, std::string()); 199 registry->RegisterStringPref(prefs::kMetricsClientID, std::string());
200 registry->RegisterInt64Pref(prefs::kMetricsReportingEnabledTimestamp, 0); 200 registry->RegisterInt64Pref(prefs::kMetricsReportingEnabledTimestamp, 0);
201 registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource, 201 registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource,
202 kLowEntropySourceNotSet); 202 kLowEntropySourceNotSet);
203 registry->RegisterInt64Pref(prefs::kSetupMetricsLastSeen, 0);
203 204
204 ClonedInstallDetector::RegisterPrefs(registry); 205 ClonedInstallDetector::RegisterPrefs(registry);
205 CachingPermutedEntropyProvider::RegisterPrefs(registry); 206 CachingPermutedEntropyProvider::RegisterPrefs(registry);
206 } 207 }
207 208
208 void MetricsStateManager::BackUpCurrentClientInfo() { 209 void MetricsStateManager::BackUpCurrentClientInfo() {
209 ClientInfo client_info; 210 ClientInfo client_info;
210 client_info.client_id = client_id_; 211 client_info.client_id = client_id_;
211 client_info.installation_date = local_state_->GetInt64(prefs::kInstallDate); 212 client_info.installation_date = local_state_->GetInt64(prefs::kInstallDate);
212 client_info.reporting_enabled_date = 213 client_info.reporting_enabled_date =
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 301
301 local_state_->ClearPref(prefs::kMetricsClientID); 302 local_state_->ClearPref(prefs::kMetricsClientID);
302 local_state_->ClearPref(prefs::kMetricsLowEntropySource); 303 local_state_->ClearPref(prefs::kMetricsLowEntropySource);
303 local_state_->ClearPref(prefs::kMetricsResetIds); 304 local_state_->ClearPref(prefs::kMetricsResetIds);
304 305
305 // Also clear the backed up client info. 306 // Also clear the backed up client info.
306 store_client_info_.Run(ClientInfo()); 307 store_client_info_.Run(ClientInfo());
307 } 308 }
308 309
309 } // namespace metrics 310 } // namespace metrics
OLDNEW
« chrome/installer/util/google_update_constants.h ('K') | « components/metrics/metrics_pref_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698