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

Unified Diff: ash/wm/window_cycle_controller.cc

Issue 12618014: Switch Next Window Key functionality (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: protect against alt+tab+switch_windows interaction Created 7 years, 9 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/window_cycle_controller.h ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_cycle_controller.cc
diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc
index 2aae2a67641641840d468baa7ea7281f68104782..419608f97892f821f0b6042d539bb30ffa9d6401 100644
--- a/ash/wm/window_cycle_controller.cc
+++ b/ash/wm/window_cycle_controller.cc
@@ -149,13 +149,25 @@ void WindowCycleController::HandleCycleWindow(Direction direction,
}
}
+void WindowCycleController::HandleLinearCycleWindow() {
+ if (!CanCycle() || IsCycling())
+ return;
+
+ // Use the reversed list of windows to prevent a 2-cycle of the most recent
+ // windows occurring.
+ windows_.reset(new WindowCycleList(BuildWindowList(NULL, true)));
James Cook 2013/03/22 16:45:36 I would just make the WindowCycleList a local vari
+ Step(FORWARD);
+ windows_.reset();
+}
+
void WindowCycleController::AltKeyReleased() {
StopCycling();
}
// static
std::vector<aura::Window*> WindowCycleController::BuildWindowList(
- const std::list<aura::Window*>* mru_windows) {
+ const std::list<aura::Window*>* mru_windows,
+ bool reverse_order) {
James Cook 2013/03/22 16:45:36 I would either change the sense of this boolean to
WindowCycleList::WindowList windows;
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
@@ -198,7 +210,8 @@ std::vector<aura::Window*> WindowCycleController::BuildWindowList(
}
// Window cycling expects the topmost window at the front of the list.
- std::reverse(windows.begin(), windows.end());
+ if (!reverse_order)
+ std::reverse(windows.begin(), windows.end());
return windows;
}
@@ -225,7 +238,7 @@ void WindowCycleController::OnRootWindowAdded(aura::RootWindow* root_window) {
// WindowCycleController, private:
void WindowCycleController::StartCycling() {
- windows_.reset(new WindowCycleList(BuildWindowList(&mru_windows_)));
+ windows_.reset(new WindowCycleList(BuildWindowList(&mru_windows_, false)));
}
void WindowCycleController::Step(Direction direction) {
« no previous file with comments | « ash/wm/window_cycle_controller.h ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698