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_; |