| Index: ash/common/wm/overview/window_selector.cc
|
| diff --git a/ash/common/wm/overview/window_selector.cc b/ash/common/wm/overview/window_selector.cc
|
| index 3d79eb23d4d7415c005a8ef290b9bf74ad7f4acd..36bc4a8a777adbc3d4a35ef7e7ef1ca47107a850 100644
|
| --- a/ash/common/wm/overview/window_selector.cc
|
| +++ b/ash/common/wm/overview/window_selector.cc
|
| @@ -455,14 +455,22 @@ void WindowSelector::OnGridEmpty(WindowGrid* grid) {
|
| }
|
|
|
| void WindowSelector::SelectWindow(WmWindow* window) {
|
| - // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting
|
| - // a window other than the window that was active prior to entering overview
|
| - // mode (i.e., the window at the front of the MRU list).
|
| std::vector<WmWindow*> window_list =
|
| WmShell::Get()->GetMruWindowTracker()->BuildMruWindowList();
|
| - if (!window_list.empty() && window_list[0] != window) {
|
| - WmShell::Get()->RecordUserMetricsAction(
|
| - UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED);
|
| + if (!window_list.empty()) {
|
| + // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting
|
| + // a window other than the window that was active prior to entering overview
|
| + // mode (i.e., the window at the front of the MRU list).
|
| + if (window_list[0] != window) {
|
| + WmShell::Get()->RecordUserMetricsAction(
|
| + UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED);
|
| + }
|
| + const auto it = std::find(window_list.begin(), window_list.end(), window);
|
| + if (it != window_list.end()) {
|
| + // Record 1-based index so that selecting a top MRU window will record 1.
|
| + UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.SelectionDepth",
|
| + 1 + it - window_list.begin());
|
| + }
|
| }
|
|
|
| window->GetWindowState()->Activate();
|
|
|