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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 // Show a phantom window for dragging in another root window. | 307 // Show a phantom window for dragging in another root window. |
308 if (HasSecondaryRootWindow()) | 308 if (HasSecondaryRootWindow()) |
309 UpdateDragPhantomWindow(bounds, in_original_root); | 309 UpdateDragPhantomWindow(bounds, in_original_root); |
310 else | 310 else |
311 drag_phantom_window_controller_.reset(); | 311 drag_phantom_window_controller_.reset(); |
312 | 312 |
313 } | 313 } |
314 | 314 |
315 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { | 315 void WorkspaceWindowResizer::CompleteDrag(int event_flags) { |
| 316 wm::SetUserHasChangedWindowPositionOrSize(details_.window, true); |
316 window()->layer()->SetOpacity(details_.initial_opacity); | 317 window()->layer()->SetOpacity(details_.initial_opacity); |
317 drag_phantom_window_controller_.reset(); | 318 drag_phantom_window_controller_.reset(); |
318 snap_phantom_window_controller_.reset(); | 319 snap_phantom_window_controller_.reset(); |
319 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) | 320 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) |
320 return; | 321 return; |
321 | 322 |
322 // When the window is not in the normal show state, we do not snap thw window. | 323 // When the window is not in the normal show state, we do not snap thw window. |
323 // This happens when the user minimizes or maximizes the window by keyboard | 324 // This happens when the user minimizes or maximizes the window by keyboard |
324 // shortcut while dragging it. If the window is the result of dragging a tab | 325 // shortcut while dragging it. If the window is the result of dragging a tab |
325 // out of a maximized window, it's already in the normal show state when this | 326 // out of a maximized window, it's already in the normal show state when this |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 gfx::Rect layer_bounds = layer_->bounds(); | 828 gfx::Rect layer_bounds = layer_->bounds(); |
828 layer_bounds.set_origin(gfx::Point(0, 0)); | 829 layer_bounds.set_origin(gfx::Point(0, 0)); |
829 layer_->SetBounds(layer_bounds); | 830 layer_->SetBounds(layer_bounds); |
830 layer_->SetVisible(false); | 831 layer_->SetVisible(false); |
831 // Detach it from the current container. | 832 // Detach it from the current container. |
832 layer_->parent()->Remove(layer_); | 833 layer_->parent()->Remove(layer_); |
833 } | 834 } |
834 | 835 |
835 } // namespace internal | 836 } // namespace internal |
836 } // namespace ash | 837 } // namespace ash |
OLD | NEW |