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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 277 } |
278 // Show a phantom window for dragging in another root window. | 278 // Show a phantom window for dragging in another root window. |
279 if (HasSecondaryRootWindow()) | 279 if (HasSecondaryRootWindow()) |
280 UpdateDragPhantomWindow(bounds, in_original_root); | 280 UpdateDragPhantomWindow(bounds, in_original_root); |
281 else | 281 else |
282 drag_phantom_window_controller_.reset(); | 282 drag_phantom_window_controller_.reset(); |
283 | 283 |
284 } | 284 } |
285 | 285 |
286 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { | 286 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { |
| 287 wm::SetUserHasChangedWindowPositionOrSize(details_.window, true); |
287 window()->layer()->SetOpacity(details_.initial_opacity); | 288 window()->layer()->SetOpacity(details_.initial_opacity); |
288 drag_phantom_window_controller_.reset(); | 289 drag_phantom_window_controller_.reset(); |
289 snap_phantom_window_controller_.reset(); | 290 snap_phantom_window_controller_.reset(); |
290 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) | 291 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) |
291 return; | 292 return; |
292 | 293 |
293 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) { | 294 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) { |
294 if (!GetRestoreBoundsInScreen(window())) | 295 if (!GetRestoreBoundsInScreen(window())) |
295 SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ? | 296 SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ? |
296 details_.initial_bounds : | 297 details_.initial_bounds : |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 gfx::Rect layer_bounds = layer_->bounds(); | 793 gfx::Rect layer_bounds = layer_->bounds(); |
793 layer_bounds.set_origin(gfx::Point(0, 0)); | 794 layer_bounds.set_origin(gfx::Point(0, 0)); |
794 layer_->SetBounds(layer_bounds); | 795 layer_->SetBounds(layer_bounds); |
795 layer_->SetVisible(false); | 796 layer_->SetVisible(false); |
796 // Detach it from the current container. | 797 // Detach it from the current container. |
797 layer_->parent()->Remove(layer_); | 798 layer_->parent()->Remove(layer_); |
798 } | 799 } |
799 | 800 |
800 } // namespace internal | 801 } // namespace internal |
801 } // namespace ash | 802 } // namespace ash |
OLD | NEW |