summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrobertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 17:01:35 +0000
committerrobertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 17:01:35 +0000
commit6b5f21d8a7f8c0b6b4a689f32afe62fe64d0fa04 (patch)
treebd2101b86b5f3ee1f3f27bd354880de932e668b4 /chrome/browser
parentaff38a3e93fb5a63cd9eda1b2995996f16c713ac (diff)
downloadchromium_src-6b5f21d8a7f8c0b6b4a689f32afe62fe64d0fa04.zip
chromium_src-6b5f21d8a7f8c0b6b4a689f32afe62fe64d0fa04.tar.gz
chromium_src-6b5f21d8a7f8c0b6b4a689f32afe62fe64d0fa04.tar.bz2
Review URL: http://codereview.chromium.org/62160
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main.cc11
-rw-r--r--chrome/browser/metrics/metrics_service.cc1
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 0ef576f..9e9d656 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -17,6 +17,7 @@
#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/system_monitor.h"
+#include "base/time.h"
#include "base/tracked_objects.h"
#include "base/values.h"
#include "chrome/browser/browser_main_win.h"
@@ -372,6 +373,16 @@ int BrowserMain(const MainFunctionParams& parameters) {
// services aware of all our preferences.
browser::RegisterAllPrefs(user_prefs, local_state);
+ // 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(prefs::kUninstallMetricsInstallDate);
+ if (install_date == 0) {
+ local_state->SetInt64(prefs::kUninstallMetricsInstallDate,
+ base::Time::Now().ToTimeT());
+ }
+
// Record last shutdown time into a histogram.
browser_shutdown::ReadLastShutdownInfo();
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 8e94e98..2d5b502 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -339,6 +339,7 @@ void MetricsService::RegisterPrefs(PrefService* local_state) {
local_state->RegisterInt64Pref(prefs::kUninstallMetricsPageLoadCount, 0);
local_state->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0);
+ local_state->RegisterInt64Pref(prefs::kUninstallMetricsInstallDate, 0);
local_state->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0);
local_state->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0);
local_state->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0);