Chromium Code Reviews| Index: ui/aura_shell/default_container_layout_manager.cc |
| diff --git a/ui/aura_shell/default_container_layout_manager.cc b/ui/aura_shell/default_container_layout_manager.cc |
| index 85560df3a52d279c05c967334107138a1c7d3d13..279f50e3374275ced5fbebf2f143d32729cb05fc 100644 |
| --- a/ui/aura_shell/default_container_layout_manager.cc |
| +++ b/ui/aura_shell/default_container_layout_manager.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/auto_reset.h" |
| #include "ui/aura/desktop.h" |
| +#include "ui/aura/event.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/screen_aura.h" |
| #include "ui/aura/window_types.h" |
| @@ -44,6 +45,28 @@ void DefaultContainerLayoutManager::CancelMoveOrResize( |
| drag_window_ = NULL; |
| } |
| +void DefaultContainerLayoutManager::ProcessMove( |
| + aura::Window* drag, |
| + aura::MouseEvent* event) { |
| + AutoReset<bool> reset(&ignore_calculate_bounds_, true); |
| + |
| + // TODO(oshima): Just zooming out may (and will) move/swap window without |
| + // a users's intent. We probably should scroll viewport, but that may not |
| + // be enough. See crbug.com/101826 for more discussion. |
| + workspace_manager_->SetOverview(true); |
| + |
| + gfx::Point point_in_owner = event->location(); |
| + aura::Window::ConvertPointToWindow( |
| + drag, |
| + owner_, |
| + &point_in_owner); |
| + |
| + aura::Window* swap_target = |
| + workspace_manager_->FindSwapWindowForLocation(point_in_owner); |
| + if (swap_target) |
| + workspace_manager_->SwapWindow(drag, swap_target); |
|
sky
2011/10/27 00:53:03
Don't we want to move rather than swapping?
oshima
2011/10/27 16:16:27
You're right. we want move (or rotate). I'll fix a
|
| +} |
| + |
| void DefaultContainerLayoutManager::EndMove( |
| aura::Window* drag, |
| aura::MouseEvent* evnet) { |
| @@ -52,7 +75,8 @@ void DefaultContainerLayoutManager::EndMove( |
| drag_window_ = NULL; |
| Workspace* workspace = workspace_manager_->GetActiveWorkspace(); |
| if (workspace) |
| - workspace->Layout(NULL); |
| + workspace->Layout(NULL, NULL); |
| + workspace_manager_->SetOverview(false); |
| } |
| void DefaultContainerLayoutManager::EndResize( |
| @@ -62,7 +86,8 @@ void DefaultContainerLayoutManager::EndResize( |
| drag_window_ = NULL; |
| Workspace* workspace = workspace_manager_->GetActiveWorkspace(); |
| if (workspace) |
| - workspace->Layout(NULL); |
| + workspace->Layout(NULL, NULL); |
| + workspace_manager_->SetOverview(false); |
| } |
| //////////////////////////////////////////////////////////////////////////////// |