Chromium Code Reviews| 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() { |