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

Unified Diff: ui/aura_shell/workspace/workspace_manager.cc

Issue 8391035: Drag and rotate windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 2 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: ui/aura_shell/workspace/workspace_manager.cc
diff --git a/ui/aura_shell/workspace/workspace_manager.cc b/ui/aura_shell/workspace/workspace_manager.cc
index 410ace11474528ced8138181083bd90fb09c7f42..dd6bbe4dae1cb1e80ad5864e48b7e34f47e559f4 100644
--- a/ui/aura_shell/workspace/workspace_manager.cc
+++ b/ui/aura_shell/workspace/workspace_manager.cc
@@ -69,6 +69,18 @@ Workspace* WorkspaceManager::FindBy(aura::Window* window) const {
return NULL;
}
+aura::Window* WorkspaceManager::FindSwapWindowForLocation(
+ const gfx::Point& point) {
+ for (Workspaces::const_iterator i = workspaces_.begin();
+ i != workspaces_.end();
+ ++i) {
+ aura::Window* window = (*i)->FindSwapWindowForLocation(point);
+ if (window)
+ return window;
+ }
+ return NULL;
+}
+
void WorkspaceManager::LayoutWorkspaces() {
UpdateViewport();
@@ -121,6 +133,19 @@ void WorkspaceManager::SetOverview(bool overview) {
viewport_->layer()->SetTransform(transform);
}
+void WorkspaceManager::SwapWindow(aura::Window* drag, aura::Window* target) {
+ Workspace* source_ws = FindBy(drag);
+ Workspace* target_ws = FindBy(target);
+ DCHECK(source_ws);
+ DCHECK(target_ws);
+ if (source_ws == target_ws) {
+ source_ws->SwapWindow(drag, target);
+ } else {
+ source_ws->ReplaceWindow(drag, target, true);
+ target_ws->ReplaceWindow(target, drag, false);
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// WorkspaceManager, Overridden from aura::DesktopObserver:

Powered by Google App Engine
This is Rietveld 408576698