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

Unified Diff: ash/wm/workspace/workspace_manager.cc

Issue 11417150: Implement workspace scrubbing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years 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/workspace/workspace_manager.h ('k') | ash/wm/workspace_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_manager.cc
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc
index 0f591e58be4016c68253a27a364c00afb21fe056..0426d781a3da2da6555edca6d1a35432201e3953 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -262,6 +262,33 @@ Window* WorkspaceManager::GetParentForNewWindow(Window* window) {
return desktop_workspace()->window();
}
+bool WorkspaceManager::CycleToWorkspace(CycleDirection direction) {
+ aura::Window* active_window = wm::GetActiveWindow();
+ if (!active_workspace_->window()->Contains(active_window))
+ active_window = NULL;
+
+ Workspaces::const_iterator workspace_i(FindWorkspace(active_workspace_));
+ int workspace_offset = 0;
+ if (direction == CYCLE_PREVIOUS) {
+ workspace_offset = 1;
+ if (workspace_i == workspaces_.end() - 1)
+ return false;
+ } else {
+ workspace_offset = -1;
+ if (workspace_i == workspaces_.begin())
+ return false;
+ }
+
+ Workspaces::const_iterator next_workspace_i(workspace_i + workspace_offset);
+ SetActiveWorkspace(*next_workspace_i, SWITCH_OTHER, base::TimeDelta());
+
+ // The activation controller will pick a window from the just activated
+ // workspace to activate as a result of DeactivateWindow().
+ if (active_window)
+ wm::DeactivateWindow(active_window);
+ return true;
+}
+
void WorkspaceManager::DoInitialAnimation() {
if (active_workspace_->is_maximized()) {
RootWindowController* root_controller = GetRootWindowController(
« no previous file with comments | « ash/wm/workspace/workspace_manager.h ('k') | ash/wm/workspace_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698