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

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

Issue 1138253002: Add user action for changing the active window in Ash overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 73b9c148146c1129afb2de9ddd2c4f98de5ff4cc..a3810290c33040629d0d5e7c397961c6287eeef2 100644
--- a/ash/wm/overview/window_selector_controller.cc
+++ b/ash/wm/overview/window_selector_controller.cc
@@ -20,7 +20,8 @@
namespace ash {
-WindowSelectorController::WindowSelectorController() {
+WindowSelectorController::WindowSelectorController()
+ : initially_active_window_(nullptr) {
}
WindowSelectorController::~WindowSelectorController() {
@@ -57,6 +58,7 @@ void WindowSelectorController::ToggleOverview() {
if (windows.empty())
return;
+ OnSelectionStarting();
Shell::GetInstance()->OnOverviewModeStarting();
window_selector_.reset(new WindowSelector(this));
window_selector_->Init(windows);
@@ -80,6 +82,23 @@ void WindowSelectorController::OnSelectionEnded() {
window_selector_.reset();
last_selection_time_ = base::Time::Now();
Shell::GetInstance()->OnOverviewModeEnded();
+
+ // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the active window
+ // is different from the window that was active upon entering overview
+ // mode.
+ aura::Window* active = wm::GetActiveWindow();
bruthig 2015/05/12 17:37:38 I feel like this metric should only be recorded if
oshima 2015/05/12 20:25:13 This may also change if the window is closed or an
tdanderson 2015/05/14 01:36:32 In patch set 2 the user action won't be recorded w
+ if (initially_active_window_ && active &&
+ active != initially_active_window_) {
+ Shell::GetInstance()->metrics()->RecordUserMetricsAction(
+ UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED);
+ }
+ initially_active_window_ = nullptr;
+}
+
+void WindowSelectorController::OnSelectionStarting() {
bruthig 2015/05/12 17:37:38 It would be less invasive to WindowSelectorControl
tdanderson 2015/05/14 01:36:32 Not pursuing this as per in-person discussion.
+ aura::Window* active = wm::GetActiveWindow();
+ if (active && WindowSelector::IsSelectable(active))
+ initially_active_window_ = active;
}
void WindowSelectorController::OnSelectionStarted() {

Powered by Google App Engine
This is Rietveld 408576698