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.

BUG=621562

Review-Url: https://codereview.chromium.org/2096063002
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();
WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_CYCLE);
UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.Items",
window_list.size());
}
//////////////////////////////////////////////////////////////////////////////
......@@ -105,6 +107,8 @@ void WindowCycleController::Step(Direction direction) {
}
void WindowCycleController::StopCycling() {
UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.SelectionDepth",
window_cycle_list_->current_index() + 1);
window_cycle_list_.reset();
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_; }
private:
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>
 
<histogram name="Ash.WindowCycleController.CycleTime" units="ms">
<owner>flackr@chromium.org</owner>
<owner>kuscher@google.com</owner>
<owner>varkha@chromium.org</owner>
<owner>tbuckley@google.com</owner>
<summary>
The amount of time the Alt key is held after pressing Alt+Tab to begin
cycling through windows.
</summary>
</histogram>
 
<histogram name="Ash.WindowCycleController.Items" units="items">
<owner>varkha@chromium.org</owner>
<owner>tbuckley@google.com</owner>
<summary>
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.
</summary>
</histogram>
<histogram name="Ash.WindowCycleController.SelectionDepth" units="items">
<owner>varkha@chromium.org</owner>
<owner>tbuckley@google.com</owner>
<summary>
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.
</summary>
</histogram>
<histogram name="Ash.WindowCycleController.TimeBetweenTaskSwitches"
units="seconds">
<owner>tdanderson@google.com</owner>
<owner>bruthig@google.com</owner>
<owner>varkha@chromium.org</owner>
<owner>tbuckley@google.com</owner>
<summary>
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