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

Unified Diff: ash/wm/window_cycle_controller.cc

Issue 20415002: Add window overview mode behind --ash-enable-overview-mode flag to F5 key. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 5 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/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,

Powered by Google App Engine
This is Rietveld 408576698