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); | |
317 window()->layer()->SetOpacity(details_.initial_opacity); | 316 window()->layer()->SetOpacity(details_.initial_opacity); |
318 drag_phantom_window_controller_.reset(); | 317 drag_phantom_window_controller_.reset(); |
319 snap_phantom_window_controller_.reset(); | 318 snap_phantom_window_controller_.reset(); |
320 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) | 319 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) |
321 return; | 320 return; |
322 | 321 |
323 // When the window is not in the normal show state, we do not snap thw window. | 322 // When the window is not in the normal show state, we do not snap thw window. |
324 // This happens when the user minimizes or maximizes the window by keyboard | 323 // This happens when the user minimizes or maximizes the window by keyboard |
325 // shortcut while dragging it. If the window is the result of dragging a tab | 324 // shortcut while dragging it. If the window is the result of dragging a tab |
326 // out of a maximized window, it's already in the normal show state when this | 325 // 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... |
828 gfx::Rect layer_bounds = layer_->bounds(); | 827 gfx::Rect layer_bounds = layer_->bounds(); |
829 layer_bounds.set_origin(gfx::Point(0, 0)); | 828 layer_bounds.set_origin(gfx::Point(0, 0)); |
830 layer_->SetBounds(layer_bounds); | 829 layer_->SetBounds(layer_bounds); |
831 layer_->SetVisible(false); | 830 layer_->SetVisible(false); |
832 // Detach it from the current container. | 831 // Detach it from the current container. |
833 layer_->parent()->Remove(layer_); | 832 layer_->parent()->Remove(layer_); |
834 } | 833 } |
835 | 834 |
836 } // namespace internal | 835 } // namespace internal |
837 } // namespace ash | 836 } // namespace ash |
OLD | NEW |