Commit a81779b5 authored by varkha's avatar varkha Committed by Commit bot
Browse files

[ash-md] Adds UMA items count and selection depth for Alt+Tab

Adds Ash.WindowCycleController.Items UMA histogram that records how
many windows are included in Alt+Tab enumeration. The count is captured
when Alt+Tab is pressed.

Adds Ash.WindowCycleController.SelectionDepth UMA histogram that records
how often users finish Alt+Tab selection on a window that is N-th in MRU
order. Selecting a window that is already currently active (top in MRU
order) records 1.


Cr-Commit-Position: refs/heads/master@{#402365}
parent 2840f95e
......@@ -94,6 +94,8 @@ void WindowCycleController::StartCycling() {
event_handler_.reset(new WindowCycleEventFilter());
cycle_start_time_ = base::Time::Now();
......@@ -105,6 +107,8 @@ void WindowCycleController::Step(Direction direction) {
void WindowCycleController::StopCycling() {
window_cycle_list_->current_index() + 1);
WmWindow* active_window_after_window_cycle = GetActiveWindow(
......@@ -31,6 +31,8 @@ class ASH_EXPORT WindowCycleList : public WmWindowObserver {
// Cycles to the next or previous window based on |direction|.
void Step(WindowCycleController::Direction direction);
int current_index() const { return current_index_; }
friend class WindowCycleControllerTest;
const WindowList& windows() const { return windows_; }
......@@ -47,7 +49,8 @@ class ASH_EXPORT WindowCycleList : public WmWindowObserver {
// alt key).
WindowList windows_;
// Current position in the |windows_|
// Current position in the |windows_|. Can be used to query selection depth,
// i.e., the position of an active window in a global MRU ordering.
int current_index_;
// Wrapper for the window brought to the front.
......@@ -1516,18 +1516,38 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<histogram name="Ash.WindowCycleController.CycleTime" units="ms">
The amount of time the Alt key is held after pressing Alt+Tab to begin
cycling through windows.
<histogram name="Ash.WindowCycleController.Items" units="items">
The number of windows in the Alt+Tab selector. Only recorded once when
cycling starts, not every time when Tab is pressed without releasing Alt.
<histogram name="Ash.WindowCycleController.SelectionDepth" units="items">
When a window is selected after pressing Alt+Tab, records that window's
position in the global MRU ordering. 1 represents the most-recently used
window, 2 represents the next most-recently used window, and so on. Recorded
when Alt+Tab cycling stops, i.e., when Alt key is released.
<histogram name="Ash.WindowCycleController.TimeBetweenTaskSwitches"
The number of seconds between task switches triggered by the next window and
previous window accelerator keys (ie Alt+Tab, Alt+Shift+Tab).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment