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

Unified Diff: ash/metrics/user_metrics_recorder.cc

Issue 1124153007: Added the Ash.Tab.TimeBetweenSwitchToExistingTabUserActions histogram to track time between tab swit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the branch that the diff was based on. Created 5 years, 7 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: ash/metrics/user_metrics_recorder.cc
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index e9929402dd3295ab22e4c73ba238ec256777235c..c3d1ec511d62ce81336d900e3127b1f13fa8a23a 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -4,6 +4,7 @@
#include "ash/metrics/user_metrics_recorder.h"
+#include "ash/metrics/user_metrics_recorder_proxy.h"
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf_delegate.h"
#include "ash/shelf/shelf_item_types.h"
@@ -12,6 +13,7 @@
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/wm/window_state.h"
@@ -182,10 +184,16 @@ void RecordShelfItemCounts() {
} // namespace
UserMetricsRecorder::UserMetricsRecorder() {
- StartTimer();
+ Init(true);
}
UserMetricsRecorder::UserMetricsRecorder(bool record_periodic_metrics) {
+ Init(record_periodic_metrics);
+}
+
+void UserMetricsRecorder::Init(bool record_periodic_metrics) {
+ user_metrics_recorder_proxy_.reset(
+ ash::Shell::GetInstance()->delegate()->CreateUserMetricsRecorderProxy());
if (record_periodic_metrics)
StartTimer();
}

Powered by Google App Engine
This is Rietveld 408576698