| 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 return; | 767 return; |
| 768 | 768 |
| 769 SnapType last_type = snap_type_; | 769 SnapType last_type = snap_type_; |
| 770 snap_type_ = GetSnapType(location); | 770 snap_type_ = GetSnapType(location); |
| 771 if (snap_type_ == SNAP_NONE || snap_type_ != last_type) { | 771 if (snap_type_ == SNAP_NONE || snap_type_ != last_type) { |
| 772 snap_phantom_window_controller_.reset(); | 772 snap_phantom_window_controller_.reset(); |
| 773 snap_sizer_.reset(); | 773 snap_sizer_.reset(); |
| 774 if (snap_type_ == SNAP_NONE) | 774 if (snap_type_ == SNAP_NONE) |
| 775 return; | 775 return; |
| 776 } | 776 } |
| 777 if (!snap_sizer_.get()) { | 777 if (!snap_sizer_) { |
| 778 SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ? | 778 SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ? |
| 779 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; | 779 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; |
| 780 snap_sizer_.reset(new SnapSizer(window(), | 780 snap_sizer_.reset(new SnapSizer(window(), |
| 781 location, | 781 location, |
| 782 edge, | 782 edge, |
| 783 internal::SnapSizer::OTHER_INPUT)); | 783 internal::SnapSizer::OTHER_INPUT)); |
| 784 } else { | 784 } else { |
| 785 snap_sizer_->Update(location); | 785 snap_sizer_->Update(location); |
| 786 } | 786 } |
| 787 if (!snap_phantom_window_controller_.get()) { | 787 if (!snap_phantom_window_controller_) { |
| 788 snap_phantom_window_controller_.reset( | 788 snap_phantom_window_controller_.reset( |
| 789 new PhantomWindowController(window())); | 789 new PhantomWindowController(window())); |
| 790 } | 790 } |
| 791 snap_phantom_window_controller_->Show(ScreenAsh::ConvertRectToScreen( | 791 snap_phantom_window_controller_->Show(ScreenAsh::ConvertRectToScreen( |
| 792 window()->parent(), snap_sizer_->target_bounds())); | 792 window()->parent(), snap_sizer_->target_bounds())); |
| 793 } | 793 } |
| 794 | 794 |
| 795 void WorkspaceWindowResizer::RestackWindows() { | 795 void WorkspaceWindowResizer::RestackWindows() { |
| 796 if (attached_windows_.empty()) | 796 if (attached_windows_.empty()) |
| 797 return; | 797 return; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 gfx::Rect area(ScreenAsh::GetDisplayBoundsInParent(window())); | 830 gfx::Rect area(ScreenAsh::GetDisplayBoundsInParent(window())); |
| 831 if (location.x() <= area.x()) | 831 if (location.x() <= area.x()) |
| 832 return SNAP_LEFT_EDGE; | 832 return SNAP_LEFT_EDGE; |
| 833 if (location.x() >= area.right() - 1) | 833 if (location.x() >= area.right() - 1) |
| 834 return SNAP_RIGHT_EDGE; | 834 return SNAP_RIGHT_EDGE; |
| 835 return SNAP_NONE; | 835 return SNAP_NONE; |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace internal | 838 } // namespace internal |
| 839 } // namespace ash | 839 } // namespace ash |
| OLD | NEW |