| Index: ash/wm/window_cycle_controller.cc
|
| diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc
|
| index 89af6c1836f8548ee56c5c4ded9f0eed40dabd9c..798123afe730ce0770e6e7dca52fe9b8e15c0499 100644
|
| --- a/ash/wm/window_cycle_controller.cc
|
| +++ b/ash/wm/window_cycle_controller.cc
|
| @@ -11,6 +11,7 @@
|
| #include "ash/shell_window_ids.h"
|
| #include "ash/wm/activation_controller.h"
|
| #include "ash/wm/window_cycle_list.h"
|
| +#include "ash/wm/window_selector.h"
|
| #include "ash/wm/window_util.h"
|
| #include "ash/wm/workspace_controller.h"
|
| #include "ui/aura/root_window.h"
|
| @@ -164,6 +165,31 @@ void WindowCycleController::AltKeyReleased() {
|
| StopCycling();
|
| }
|
|
|
| +void WindowCycleController::ToggleOverview() {
|
| + if (window_selector_.get()) {
|
| + window_selector_.reset();
|
| + } else {
|
| + std::vector<aura::Window*> windows = BuildWindowList(NULL, false);
|
| + // Don't enter overview mode with no windows.
|
| + if (windows.empty())
|
| + return;
|
| +
|
| + // Deactivating the window will hide popup windows like the omnibar or
|
| + // open menus.
|
| + aura::Window* active_window = wm::GetActiveWindow();
|
| + if (active_window)
|
| + wm::DeactivateWindow(active_window);
|
| + window_selector_.reset(new WindowSelector(windows, this));
|
| + }
|
| +}
|
| +
|
| +void WindowCycleController::SelectWindow(aura::Window* window) {
|
| + window_selector_.reset();
|
| + wm::ActivateWindow(window);
|
| + mru_windows_.remove(window);
|
| + mru_windows_.push_front(window);
|
| +}
|
| +
|
| // static
|
| std::vector<aura::Window*> WindowCycleController::BuildWindowList(
|
| const std::list<aura::Window*>* mru_windows,
|
|
|