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

Unified Diff: ash/wm/overview/window_selector_controller.cc

Issue 24096024: Add UMA metrics for window selection and overview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add descriptions. Created 7 years, 3 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
Index: ash/wm/overview/window_selector_controller.cc
diff --git a/ash/wm/overview/window_selector_controller.cc b/ash/wm/overview/window_selector_controller.cc
index f9839dcb43a7669f5ad66334d5821abc65cf33ef..c9d9e2c72f4a8ac47c0cc0c9821e8620de774dc2 100644
--- a/ash/wm/overview/window_selector_controller.cc
+++ b/ash/wm/overview/window_selector_controller.cc
@@ -6,9 +6,11 @@
#include "ash/session_state_delegate.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector.h"
#include "ash/wm/window_util.h"
+#include "base/metrics/histogram.h"
namespace ash {
@@ -36,9 +38,9 @@ void WindowSelectorController::ToggleOverview() {
if (windows.empty())
return;
- // Removing focus will hide popup windows like the omnibar or open menus.
window_selector_.reset(
new WindowSelector(windows, WindowSelector::OVERVIEW, this));
+ OnSelectionStarted();
}
}
@@ -54,9 +56,9 @@ void WindowSelectorController::HandleCycleWindow(
if (windows.empty())
return;
- // Removing focus will hide popup windows like the omnibar or open menus.
window_selector_.reset(
new WindowSelector(windows, WindowSelector::CYCLE, this));
+ OnSelectionStarted();
window_selector_->Step(direction);
} else if (window_selector_->mode() == WindowSelector::CYCLE) {
window_selector_->Step(direction);
@@ -70,10 +72,22 @@ bool WindowSelectorController::IsSelecting() {
void WindowSelectorController::OnWindowSelected(aura::Window* window) {
window_selector_.reset();
wm::ActivateWindow(window);
+ last_selection_time_ = base::Time::Now();
}
void WindowSelectorController::OnSelectionCanceled() {
window_selector_.reset();
+ last_selection_time_ = base::Time::Now();
+}
+
+void WindowSelectorController::OnSelectionStarted() {
+ if (!last_selection_time_.is_null()) {
+ Shell* shell = Shell::GetInstance();
+ shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_SELECTION);
Ilya Sherman 2013/09/19 23:08:04 Why is this gated on whether or not the last_selec
flackr 2013/09/19 23:23:45 Good catch, this should not be.
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Ash.WindowSelector.TimeBetweenUse",
+ base::Time::Now() - last_selection_time_);
Ilya Sherman 2013/09/19 23:08:04 Hmm, is LONG_TIMES really enough? I'd expect it t
flackr 2013/09/19 23:23:45 In terms of usage, I think the exact timing beyond
+ }
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698