| 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_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ | 5 #ifndef ASH_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ |
| 6 #define ASH_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ | 6 #define ASH_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 class Rect; | 11 class Rect; |
| 12 class Size; | 12 class Size; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 namespace wm { | |
| 17 | 16 |
| 18 class WmWindow; | 17 class WmWindow; |
| 19 | 18 |
| 19 namespace wm { |
| 20 |
| 20 // We force at least this many DIPs for any window on the screen. | 21 // We force at least this many DIPs for any window on the screen. |
| 21 const int kMinimumOnScreenArea = 25; | 22 const int kMinimumOnScreenArea = 25; |
| 22 | 23 |
| 23 // Adjusts |bounds| so that the size does not exceed |max_size|. | 24 // Adjusts |bounds| so that the size does not exceed |max_size|. |
| 24 ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, | 25 ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, |
| 25 gfx::Rect* bounds); | 26 gfx::Rect* bounds); |
| 26 | 27 |
| 27 // Move the given bounds inside the given |visible_area| in parent coordinates, | 28 // Move the given bounds inside the given |visible_area| in parent coordinates, |
| 28 // including a safety margin given by |min_width| and |min_height|. | 29 // including a safety margin given by |min_width| and |min_height|. |
| 29 // This also ensures that the top of the bounds is visible. | 30 // This also ensures that the top of the bounds is visible. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 // Returns the bounds of a right snapped window with default width in parent | 49 // Returns the bounds of a right snapped window with default width in parent |
| 49 // coordinates. | 50 // coordinates. |
| 50 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( | 51 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( |
| 51 WmWindow* window); | 52 WmWindow* window); |
| 52 | 53 |
| 53 } // namespace wm | 54 } // namespace wm |
| 54 } // namespace ash | 55 } // namespace ash |
| 55 | 56 |
| 56 #endif // ASH_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ | 57 #endif // ASH_COMMON_WM_WINDOW_POSITIONING_UTILS_H_ |
| OLD | NEW |