| 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 phantom_bounds = GetTarget()->GetParent()->ConvertRectFromScreen( | 945 phantom_bounds = GetTarget()->GetParent()->ConvertRectFromScreen( |
| 946 dock_layout_->dragged_bounds()); | 946 dock_layout_->dragged_bounds()); |
| 947 } else { | 947 } else { |
| 948 phantom_bounds = | 948 phantom_bounds = |
| 949 (snap_type_ == SNAP_LEFT) | 949 (snap_type_ == SNAP_LEFT) |
| 950 ? wm::GetDefaultLeftSnappedWindowBoundsInParent(GetTarget()) | 950 ? wm::GetDefaultLeftSnappedWindowBoundsInParent(GetTarget()) |
| 951 : wm::GetDefaultRightSnappedWindowBoundsInParent(GetTarget()); | 951 : wm::GetDefaultRightSnappedWindowBoundsInParent(GetTarget()); |
| 952 } | 952 } |
| 953 | 953 |
| 954 if (!snap_phantom_window_controller_) { | 954 if (!snap_phantom_window_controller_) { |
| 955 snap_phantom_window_controller_.reset(new PhantomWindowController( | 955 snap_phantom_window_controller_.reset( |
| 956 wm::WmWindowAura::GetAuraWindow(GetTarget()))); | 956 new PhantomWindowController(GetTarget())); |
| 957 } | 957 } |
| 958 snap_phantom_window_controller_->Show( | 958 snap_phantom_window_controller_->Show( |
| 959 GetTarget()->GetParent()->ConvertRectToScreen(phantom_bounds)); | 959 GetTarget()->GetParent()->ConvertRectToScreen(phantom_bounds)); |
| 960 } | 960 } |
| 961 | 961 |
| 962 void WorkspaceWindowResizer::RestackWindows() { | 962 void WorkspaceWindowResizer::RestackWindows() { |
| 963 if (attached_windows_.empty()) | 963 if (attached_windows_.empty()) |
| 964 return; | 964 return; |
| 965 // Build a map from index in children to window, returning if there is a | 965 // Build a map from index in children to window, returning if there is a |
| 966 // window with a different parent. | 966 // window with a different parent. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED || | 1032 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED || |
| 1033 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); | 1033 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); |
| 1034 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget()); | 1034 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget()); |
| 1035 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) | 1035 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) |
| 1036 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); | 1036 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); |
| 1037 snapped_bounds.set_width(bounds_in_parent.width()); | 1037 snapped_bounds.set_width(bounds_in_parent.width()); |
| 1038 return bounds_in_parent == snapped_bounds; | 1038 return bounds_in_parent == snapped_bounds; |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 } // namespace ash | 1041 } // namespace ash |
| OLD | NEW |