| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 // Show a phantom window for dragging in another root window. | 167 // Show a phantom window for dragging in another root window. |
| 168 if (HasSecondaryRootWindow()) | 168 if (HasSecondaryRootWindow()) |
| 169 UpdateDragPhantomWindow(bounds, in_original_root); | 169 UpdateDragPhantomWindow(bounds, in_original_root); |
| 170 else | 170 else |
| 171 drag_phantom_window_controller_.reset(); | 171 drag_phantom_window_controller_.reset(); |
| 172 | 172 |
| 173 } | 173 } |
| 174 | 174 |
| 175 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { | 175 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { |
| 176 wm::SetUserHasChangedWindowPositionOrSize(details_.window, true); |
| 176 window()->layer()->SetOpacity(details_.initial_opacity); | 177 window()->layer()->SetOpacity(details_.initial_opacity); |
| 177 drag_phantom_window_controller_.reset(); | 178 drag_phantom_window_controller_.reset(); |
| 178 snap_phantom_window_controller_.reset(); | 179 snap_phantom_window_controller_.reset(); |
| 179 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) | 180 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) |
| 180 return; | 181 return; |
| 181 | 182 |
| 182 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) { | 183 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) { |
| 183 if (!GetRestoreBoundsInScreen(window())) | 184 if (!GetRestoreBoundsInScreen(window())) |
| 184 SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ? | 185 SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ? |
| 185 details_.initial_bounds : | 186 details_.initial_bounds : |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 gfx::Rect layer_bounds = layer_->bounds(); | 648 gfx::Rect layer_bounds = layer_->bounds(); |
| 648 layer_bounds.set_origin(gfx::Point(0, 0)); | 649 layer_bounds.set_origin(gfx::Point(0, 0)); |
| 649 layer_->SetBounds(layer_bounds); | 650 layer_->SetBounds(layer_bounds); |
| 650 layer_->SetVisible(false); | 651 layer_->SetVisible(false); |
| 651 // Detach it from the current container. | 652 // Detach it from the current container. |
| 652 layer_->parent()->Remove(layer_); | 653 layer_->parent()->Remove(layer_); |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace internal | 656 } // namespace internal |
| 656 } // namespace ash | 657 } // namespace ash |
| OLD | NEW |