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

Unified Diff: chrome/browser/chrome_browser_main.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_field_trials_mobile.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 42f2e7bde04f318da9ed8f6f819a4da412de0162..1bda0a05adfc887f292a1c7c69cb49cff30b69f0 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -104,7 +104,6 @@
#include "chrome/installer/util/google_update_settings.h"
#include "components/google/core/browser/google_util.h"
#include "components/language_usage_metrics/language_usage_metrics.h"
-#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_service.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/nacl_process_host.h"
@@ -601,8 +600,9 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() {
if (variations_service)
variations_service->CreateTrialsFromSeed();
- // This must be called after the local state is initialized.
- browser_field_trials_.SetupFieldTrials(local_state_);
+ // This must be called after |local_state_| is initialized.
+ browser_field_trials_.SetupFieldTrials(
+ base::Time::FromTimeT(metrics->GetInstallDate()), local_state_);
// Initialize FieldTrialSynchronizer system. This is a singleton and is used
// for posting tasks via base::Bind. Its deleted when it goes out of scope.
@@ -937,15 +937,6 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
// Initialize tracking synchronizer system.
tracking_synchronizer_ = new chrome_browser_metrics::TrackingSynchronizer();
- // Now that all preferences have been registered, set the install date
- // for the uninstall metrics if this is our first run. This only actually
- // gets used if the user has metrics reporting enabled at uninstall time.
- int64 install_date = local_state_->GetInt64(metrics::prefs::kInstallDate);
- if (install_date == 0) {
- local_state_->SetInt64(metrics::prefs::kInstallDate,
- base::Time::Now().ToTimeT());
- }
-
#if defined(OS_MACOSX)
// Get the Keychain API to register for distributed notifications on the main
// thread, which has a proper CFRunloop, instead of later on the I/O thread,
« no previous file with comments | « chrome/browser/chrome_browser_field_trials_mobile.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698