| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // implement proper transition from one resizer to another during or at the | 65 // implement proper transition from one resizer to another during or at the |
| 66 // end of the drag. This also causes http://crbug.com/247085. | 66 // end of the drag. This also causes http://crbug.com/247085. |
| 67 // It seems the only thing the panel or dock resizer needs to do is notify the | 67 // It seems the only thing the panel or dock resizer needs to do is notify the |
| 68 // layout manager when a docked window is being dragged. We should have a | 68 // layout manager when a docked window is being dragged. We should have a |
| 69 // better way of doing this, perhaps by having a way of observing drags or | 69 // better way of doing this, perhaps by having a way of observing drags or |
| 70 // having a generic drag window wrapper which informs a layout manager that a | 70 // having a generic drag window wrapper which informs a layout manager that a |
| 71 // drag has started or stopped. | 71 // drag has started or stopped. |
| 72 // It may be possible to refactor and eliminate chaining. | 72 // It may be possible to refactor and eliminate chaining. |
| 73 WindowResizer* window_resizer = NULL; | 73 WindowResizer* window_resizer = NULL; |
| 74 | 74 |
| 75 if (!window_state->IsNormalOrSnapped()) | 75 if (!window_state->IsNormalOrSnapped() && !window_state->IsDocked()) |
| 76 return scoped_ptr<WindowResizer>(); | 76 return scoped_ptr<WindowResizer>(); |
| 77 | 77 |
| 78 int bounds_change = WindowResizer::GetBoundsChangeForWindowComponent( | 78 int bounds_change = WindowResizer::GetBoundsChangeForWindowComponent( |
| 79 window_component); | 79 window_component); |
| 80 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) | 80 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) |
| 81 return scoped_ptr<WindowResizer>(); | 81 return scoped_ptr<WindowResizer>(); |
| 82 | 82 |
| 83 window_state->CreateDragDetails(window, point_in_parent, window_component, | 83 window_state->CreateDragDetails(window, point_in_parent, window_component, |
| 84 source); | 84 source); |
| 85 if (window->parent() && | 85 if (window->parent() && |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); | 1050 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); |
| 1051 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( | 1051 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
| 1052 GetTarget()); | 1052 GetTarget()); |
| 1053 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) | 1053 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) |
| 1054 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); | 1054 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); |
| 1055 snapped_bounds.set_width(bounds_in_parent.width()); | 1055 snapped_bounds.set_width(bounds_in_parent.width()); |
| 1056 return bounds_in_parent == snapped_bounds; | 1056 return bounds_in_parent == snapped_bounds; |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 } // namespace ash | 1059 } // namespace ash |
| OLD | NEW |