| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_WM_WINDOW_POSITIONING_UTILS_H_ | 5 #ifndef ASH_WM_WINDOW_POSITIONING_UTILS_H_ |
| 6 #define ASH_WM_WINDOW_POSITIONING_UTILS_H_ | 6 #define ASH_WM_WINDOW_POSITIONING_UTILS_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 | 9 |
| 10 namespace aura { |
| 11 class Window; |
| 12 } |
| 13 |
| 10 namespace display { | 14 namespace display { |
| 11 class Display; | 15 class Display; |
| 12 } | 16 } |
| 13 | 17 |
| 14 namespace gfx { | 18 namespace gfx { |
| 15 class Rect; | 19 class Rect; |
| 16 class Size; | 20 class Size; |
| 17 } | 21 } |
| 18 | 22 |
| 19 namespace ash { | 23 namespace ash { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 // Move the given bounds inside the given |visible_area| in parent coordinates, | 45 // Move the given bounds inside the given |visible_area| in parent coordinates, |
| 42 // including a safety margin given by |kMinimumOnScreenArea|. | 46 // including a safety margin given by |kMinimumOnScreenArea|. |
| 43 // This also ensures that the top of the bounds is visible. | 47 // This also ensures that the top of the bounds is visible. |
| 44 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( | 48 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( |
| 45 const gfx::Rect& visible_area, | 49 const gfx::Rect& visible_area, |
| 46 gfx::Rect* bounds); | 50 gfx::Rect* bounds); |
| 47 | 51 |
| 48 // Returns the bounds of a left snapped window with default width in parent | 52 // Returns the bounds of a left snapped window with default width in parent |
| 49 // coordinates. | 53 // coordinates. |
| 50 ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( | 54 ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( |
| 51 WmWindow* window); | 55 aura::Window* window); |
| 52 | 56 |
| 53 // Returns the bounds of a right snapped window with default width in parent | 57 // Returns the bounds of a right snapped window with default width in parent |
| 54 // coordinates. | 58 // coordinates. |
| 55 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( | 59 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( |
| 56 WmWindow* window); | 60 aura::Window* window); |
| 57 | 61 |
| 58 // Moves the window to the center of the display. | 62 // Moves the window to the center of the display. |
| 59 ASH_EXPORT void CenterWindow(WmWindow* window); | 63 ASH_EXPORT void CenterWindow(WmWindow* window); |
| 60 | 64 |
| 61 // Sets the bounds of |window| to |bounds_in_screen|. This may move |window| | 65 // Sets the bounds of |window| to |bounds_in_screen|. This may move |window| |
| 62 // to |display| if necessary. | 66 // to |display| if necessary. |
| 63 ASH_EXPORT void SetBoundsInScreen(WmWindow* window, | 67 ASH_EXPORT void SetBoundsInScreen(WmWindow* window, |
| 64 const gfx::Rect& bounds_in_screen, | 68 const gfx::Rect& bounds_in_screen, |
| 65 const display::Display& display); | 69 const display::Display& display); |
| 66 | 70 |
| 67 } // namespace wm | 71 } // namespace wm |
| 68 } // namespace ash | 72 } // namespace ash |
| 69 | 73 |
| 70 #endif // ASH_WM_WINDOW_POSITIONING_UTILS_H_ | 74 #endif // ASH_WM_WINDOW_POSITIONING_UTILS_H_ |
| OLD | NEW |