diff options
Diffstat (limited to 'chromium/ash/wm/workspace/workspace_window_resizer.cc')
-rw-r--r-- | chromium/ash/wm/workspace/workspace_window_resizer.cc | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/chromium/ash/wm/workspace/workspace_window_resizer.cc b/chromium/ash/wm/workspace/workspace_window_resizer.cc index 4b8c0aaf7e9..2143e45668b 100644 --- a/chromium/ash/wm/workspace/workspace_window_resizer.cc +++ b/chromium/ash/wm/workspace/workspace_window_resizer.cc @@ -87,13 +87,8 @@ scoped_ptr<WindowResizer> CreateWindowResizer( window_resizer = PanelWindowResizer::Create( window_resizer, window, point_in_parent, window_component, source); } - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kAshEnableDockedWindows) && - window_resizer && window->parent() && - (window->parent()->id() == internal::kShellWindowId_DefaultContainer || - window->parent()->id() == internal::kShellWindowId_DockedContainer || - window->parent()->id() == internal::kShellWindowId_PanelContainer)) { - window_resizer = internal::DockedWindowResizer::Create( + if (window_resizer) { + window_resizer = DockedWindowResizer::Create( window_resizer, window, point_in_parent, window_component, source); } return make_scoped_ptr<WindowResizer>(window_resizer); @@ -103,6 +98,10 @@ namespace internal { namespace { +// Distance in pixels that the cursor must move past an edge for a window +// to move or resize beyond that edge. +const int kStickyDistancePixels = 64; + // Snapping distance used instead of WorkspaceWindowResizer::kScreenEdgeInset // when resizing a window using touchscreen. const int kScreenEdgeInsetForTouchResize = 32; @@ -117,7 +116,7 @@ bool ShouldStickToEdge(int distance_from_edge, int sticky_size) { distance_from_edge > -sticky_size; } return distance_from_edge < sticky_size && - distance_from_edge > -sticky_size * 2; + distance_from_edge > -sticky_size * 2; } // Returns the coordinate along the secondary axis to snap to. @@ -260,9 +259,6 @@ const int WorkspaceWindowResizer::kMinOnscreenHeight = 32; // static const int WorkspaceWindowResizer::kScreenEdgeInset = 8; -// static -const int WorkspaceWindowResizer::kStickyDistancePixels = 64; - // Represents the width or height of a window with constraints on its minimum // and maximum size. 0 represents a lack of a constraint. class WindowSize { @@ -509,7 +505,7 @@ gfx::Rect WorkspaceWindowResizer::GetFinalBounds( const gfx::Rect& bounds) const { if (snap_phantom_window_controller_.get() && snap_phantom_window_controller_->IsShowing()) { - return snap_phantom_window_controller_->bounds_in_screen(); + return snap_phantom_window_controller_->bounds(); } return bounds; } @@ -750,12 +746,8 @@ void WorkspaceWindowResizer::AdjustBoundsForMainWindow( } if (sticky_size > 0) { - // Possibly stick to edge except when a mouse pointer is outside the - // work area. - if (!(display.work_area().Contains(last_mouse_location_in_screen) && - StickToWorkAreaOnMove(work_area, sticky_size, bounds))) { + if (!StickToWorkAreaOnMove(work_area, sticky_size, bounds)) MagneticallySnapToOtherWindows(bounds); - } } } else if (sticky_size > 0) { MagneticallySnapResizeToOtherWindows(bounds); |