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

Unified Diff: components/metrics/metrics_service.cc

Issue 396753005: Keep all references to kInstallDate inside components/metrics/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service.cc
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index 797ec70fdc09d959ec804e018d67d2070b4675c0..c1c8df304a6d804d602d31d908f5082c3f12dae5 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -179,6 +179,7 @@
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
+#include "base/time/time.h"
#include "base/tracked_objects.h"
#include "base/values.h"
#include "components/metrics/metrics_log.h"
@@ -331,6 +332,13 @@ MetricsService::MetricsService(metrics::MetricsStateManager* state_manager,
DCHECK(state_manager_);
DCHECK(client_);
DCHECK(local_state_);
+
+ // Set the install date if this is our first run.
+ int64 install_date = local_state_->GetInt64(metrics::prefs::kInstallDate);
+ if (install_date == 0) {
+ local_state_->SetInt64(metrics::prefs::kInstallDate,
+ base::Time::Now().ToTimeT());
+ }
}
MetricsService::~MetricsService() {
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698