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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } | 779 } |
780 return false; | 780 return false; |
781 } | 781 } |
782 | 782 |
783 void WorkspaceWindowResizer::AdjustBoundsForMainWindow( | 783 void WorkspaceWindowResizer::AdjustBoundsForMainWindow( |
784 int sticky_size, | 784 int sticky_size, |
785 gfx::Rect* bounds) { | 785 gfx::Rect* bounds) { |
786 gfx::Point last_mouse_location_in_screen = last_mouse_location_; | 786 gfx::Point last_mouse_location_in_screen = last_mouse_location_; |
787 ::wm::ConvertPointToScreen(GetTarget()->parent(), | 787 ::wm::ConvertPointToScreen(GetTarget()->parent(), |
788 &last_mouse_location_in_screen); | 788 &last_mouse_location_in_screen); |
789 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint( | 789 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayNearestPoint( |
790 last_mouse_location_in_screen); | 790 last_mouse_location_in_screen); |
791 gfx::Rect work_area = | 791 gfx::Rect work_area = |
792 ScreenUtil::ConvertRectFromScreen(GetTarget()->parent(), | 792 ScreenUtil::ConvertRectFromScreen(GetTarget()->parent(), |
793 display.work_area()); | 793 display.work_area()); |
794 if (details().window_component == HTCAPTION) { | 794 if (details().window_component == HTCAPTION) { |
795 // Adjust the bounds to the work area where the mouse cursor is located. | 795 // Adjust the bounds to the work area where the mouse cursor is located. |
796 // Always keep kMinOnscreenHeight or the window height (whichever is less) | 796 // Always keep kMinOnscreenHeight or the window height (whichever is less) |
797 // on the bottom. | 797 // on the bottom. |
798 int max_y = work_area.bottom() - std::min(kMinOnscreenHeight, | 798 int max_y = work_area.bottom() - std::min(kMinOnscreenHeight, |
799 bounds->height()); | 799 bounds->height()); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); | 1055 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); |
1056 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( | 1056 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
1057 GetTarget()); | 1057 GetTarget()); |
1058 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) | 1058 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) |
1059 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); | 1059 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); |
1060 snapped_bounds.set_width(bounds_in_parent.width()); | 1060 snapped_bounds.set_width(bounds_in_parent.width()); |
1061 return bounds_in_parent == snapped_bounds; | 1061 return bounds_in_parent == snapped_bounds; |
1062 } | 1062 } |
1063 | 1063 |
1064 } // namespace ash | 1064 } // namespace ash |
OLD | NEW |