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

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: Improve the wording of histogram descriptions and fix selection uma count. 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
« no previous file with comments | « ash/wm/overview/window_selector_controller.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3a3108fc843fa169fb6590650a6772aaf8b24b72 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() {
+ Shell* shell = Shell::GetInstance();
+ shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_SELECTION);
+ if (!last_selection_time_.is_null()) {
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Ash.WindowSelector.TimeBetweenUse",
+ base::Time::Now() - last_selection_time_);
+ }
}
} // namespace ash
« no previous file with comments | « ash/wm/overview/window_selector_controller.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698