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

Unified Diff: ash/common/wm/overview/window_selector.cc

Issue 2096853002: [ash-md] Adds UMA depth count for Overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Adds UMA depth count for Overview mode (1-based index) Created 4 years, 6 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698