| 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:
|
|
|
|
|