Chromium Code Reviews| Index: ash/wm/workspace/workspace_window_resizer.cc |
| diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc |
| index 25430933827c63762fb0e9b7dcc1cc1d348f5370..762cf93f7f017563737eab987a6d134858bc9de6 100644 |
| --- a/ash/wm/workspace/workspace_window_resizer.cc |
| +++ b/ash/wm/workspace/workspace_window_resizer.cc |
| @@ -16,6 +16,8 @@ |
| #include "ash/shell_window_ids.h" |
| #include "ash/wm/coordinate_conversion.h" |
| #include "ash/wm/default_window_resizer.h" |
| +#include "ash/wm/dock/dock_layout_manager.h" |
| +#include "ash/wm/dock/dock_window_resizer.h" |
| #include "ash/wm/drag_window_resizer.h" |
| #include "ash/wm/panels/panel_window_resizer.h" |
| #include "ash/wm/property_util.h" |
| @@ -65,7 +67,11 @@ scoped_ptr<WindowResizer> CreateWindowResizer(aura::Window* window, |
| window_resizer = internal::DragWindowResizer::Create( |
| window_resizer, window, point_in_parent, window_component); |
| } |
| - if (window_resizer && window->type() == aura::client::WINDOW_TYPE_PANEL) { |
| + if (window_resizer && GetDockEdge(window) != DOCK_EDGE_NONE) { |
| + window_resizer = DockWindowResizer::Create( |
| + window_resizer, window, point_in_parent, window_component); |
| + } else if (window_resizer && |
| + window->type() == aura::client::WINDOW_TYPE_PANEL) { |
|
flackr
2013/06/04 19:58:10
Should this really be an else if? Wouldn't this pr
varkha
2013/06/07 19:01:28
It would (for the panels). This is a symmetrical s
|
| window_resizer = PanelWindowResizer::Create( |
| window_resizer, window, point_in_parent, window_component); |
| } |
| @@ -303,6 +309,13 @@ class WindowSize { |
| WorkspaceWindowResizer::~WorkspaceWindowResizer() { |
| Shell* shell = Shell::GetInstance(); |
| shell->cursor_manager()->UnlockCursor(); |
| + |
| + if (GetDockEdge(window()) != dock_edge_ && |
| + CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kAshEnableDockedWindows)) |
| + if (window()->type() != aura::client::WINDOW_TYPE_PANEL || |
| + !window()->GetProperty(internal::kPanelAttachedKey)) |
| + SetDockEdge(window(), dock_edge_); |
|
flackr
2013/06/04 19:58:10
This should probably be in CompleteDrag. Also we s
varkha
2013/06/07 19:01:28
Done (the first part). The second part may get add
|
| } |
| // static |
| @@ -368,7 +381,7 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) { |
| if (!did_move_or_resize_ || details_.window_component != HTCAPTION) |
| return; |
| - // When the window is not in the normal show state, we do not snap thw window. |
| + // When the window is not in the normal show state, we do not snap the window. |
| // This happens when the user minimizes or maximizes the window by keyboard |
| // shortcut while dragging it. If the window is the result of dragging a tab |
| // out of a maximized window, it's already in the normal show state when this |
| @@ -433,6 +446,7 @@ WorkspaceWindowResizer::WorkspaceWindowResizer( |
| total_min_(0), |
| total_initial_size_(0), |
| snap_type_(SNAP_NONE), |
| + dock_edge_(DOCK_EDGE_NONE), |
| num_mouse_moves_since_bounds_change_(0), |
| magnetism_window_(NULL) { |
| DCHECK(details_.is_resizable); |
| @@ -683,6 +697,7 @@ void WorkspaceWindowResizer::AdjustBoundsForMainWindow( |
| if (sticky_size > 0) { |
| StickToWorkAreaOnMove(work_area, sticky_size, bounds); |
| MagneticallySnapToOtherWindows(bounds); |
| + dock_edge_ = DockLayoutManager::FindDockEdge(window()); |
|
flackr
2013/06/04 20:58:03
As discussed, you shouldn't need to track this sin
varkha
2013/06/07 19:01:28
Done.
|
| } |
| } else if (sticky_size > 0) { |
| MagneticallySnapResizeToOtherWindows(bounds); |