| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ |
| 6 #define ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 |
| 10 namespace gfx { |
| 11 class Rect; |
| 12 class Size; |
| 13 } |
| 14 |
| 15 namespace ash { |
| 16 namespace wm { |
| 17 |
| 18 // We force at least this many DIPs for any window on the screen. |
| 19 const int kMinimumOnScreenArea = 25; |
| 20 |
| 21 // Adjusts |bounds| so that the size does not exceed |max_size|. |
| 22 ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, |
| 23 gfx::Rect* bounds); |
| 24 |
| 25 // Move the given bounds inside the given |visible_area| in parent coordinates, |
| 26 // including a safety margin given by |min_width| and |min_height|. |
| 27 // This also ensures that the top of the bounds is visible. |
| 28 ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility( |
| 29 const gfx::Rect& visible_area, |
| 30 int min_width, |
| 31 int min_height, |
| 32 gfx::Rect* bounds); |
| 33 |
| 34 // Move the given bounds inside the given |visible_area| in parent coordinates, |
| 35 // including a safety margin given by |kMinimumOnScreenArea|. |
| 36 // This also ensures that the top of the bounds is visible. |
| 37 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( |
| 38 const gfx::Rect& visible_area, |
| 39 gfx::Rect* bounds); |
| 40 |
| 41 } // namespace wm |
| 42 } // namespace ash |
| 43 |
| 44 #endif // ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ |
| OLD | NEW |