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

Unified Diff: ash/wm/maximize_mode/maximize_mode_controller.h

Issue 914673003: Correctly record TouchView metrics on suspend/shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't assume state transitions on suspend/shutdown Created 5 years, 10 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/wm/maximize_mode/maximize_mode_controller.h
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.h b/ash/wm/maximize_mode/maximize_mode_controller.h
index f7959661cfb9f6468382b6f267da677b58196f87..491a77e6aaab969748126cd1d97b1757be3af240 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.h
+++ b/ash/wm/maximize_mode/maximize_mode_controller.h
@@ -97,6 +97,13 @@ class ASH_EXPORT MaximizeModeController :
friend class test::MultiUserWindowManagerChromeOSTest;
friend class test::VirtualKeyboardControllerTest;
+ // Used for recording metrics for intervals of time spent in
+ // and out of TouchView.
+ enum TouchViewIntervalType {
flackr 2015/02/12 19:59:06 Why not a bool if we only have active an inactive?
tdanderson 2015/02/12 20:30:49 I prefer enums over bools in cases where it would
flackr 2015/02/12 20:44:43 Can also use RecordTouchViewUsageInterval(/* touch
jonross 2015/02/12 20:49:26 using a bool would clean up some of the logic in t
tdanderson 2015/02/12 21:38:22 Rob and I had a chat offline and he's OK leaving t
+ TOUCH_VIEW_INTERVAL_INACTIVE,
+ TOUCH_VIEW_INTERVAL_ACTIVE
+ };
+
// Set the TickClock. This is only to be used by tests that need to
// artificially and deterministically control the current time.
void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock);
@@ -118,8 +125,12 @@ class ASH_EXPORT MaximizeModeController :
// is no rotation lock.
void LeaveMaximizeMode();
- // Record UMA stats tracking touchview usage.
- void RecordTouchViewStateTransition();
+ // Record UMA stats tracking TouchView usage. If |type| is
+ // TOUCH_VIEW_INTERVAL_INACTIVE, then record that TouchView has been
+ // inactive from |touchview_usage_interval_start_time_| until now.
+ // Similarly, record that TouchView has been active if |type| is
+ // TOUCH_VIEW_INTERVAL_ACTIVE.
+ void RecordTouchViewUsageInterval(TouchViewIntervalType type);
// The maximized window manager (if enabled).
scoped_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_;
@@ -135,7 +146,7 @@ class ASH_EXPORT MaximizeModeController :
bool lid_open_past_180_;
// Tracks time spent in (and out of) touchview mode.
- base::Time last_touchview_transition_time_;
+ base::Time touchview_usage_interval_start_time_;
base::TimeDelta total_touchview_time_;
base::TimeDelta total_non_touchview_time_;
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_controller.cc » ('j') | ash/wm/maximize_mode/maximize_mode_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698