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 #ifndef ASH_WM_WINDOW_UTIL_H_ | 5 #ifndef ASH_WM_WINDOW_UTIL_H_ |
6 #define ASH_WM_WINDOW_UTIL_H_ | 6 #define ASH_WM_WINDOW_UTIL_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 class Window; | 13 class Window; |
14 } | 14 } |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Rect; | 17 class Rect; |
18 class Size; | |
18 } | 19 } |
19 | 20 |
20 namespace ui { | 21 namespace ui { |
21 class Event; | 22 class Event; |
22 } | 23 } |
23 | 24 |
24 namespace ash { | 25 namespace ash { |
25 // We force at least this many DIPs for any window on the screen. | 26 // We force at least this many DIPs for any window on the screen. |
26 const int kMinimumOnScreenArea = 10; | 27 const int kMinimumOnScreenArea = 10; |
27 | 28 |
(...skipping 12 matching lines...) Expand all Loading... | |
40 // If you're looking for a function to get the activatable "top level" window, | 41 // If you're looking for a function to get the activatable "top level" window, |
41 // this is probably what you're looking for. | 42 // this is probably what you're looking for. |
42 ASH_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); | 43 ASH_EXPORT aura::Window* GetActivatableWindow(aura::Window* window); |
43 | 44 |
44 // TODO(oshima): remove this. | 45 // TODO(oshima): remove this. |
45 ASH_EXPORT bool IsWindowMinimized(aura::Window* window); | 46 ASH_EXPORT bool IsWindowMinimized(aura::Window* window); |
46 | 47 |
47 // Moves the window to the center of the display. | 48 // Moves the window to the center of the display. |
48 ASH_EXPORT void CenterWindow(aura::Window* window); | 49 ASH_EXPORT void CenterWindow(aura::Window* window); |
49 | 50 |
51 // Adjust |bounds| so that the size does not exceeds |max_size|. | |
pkotwicz
2014/02/13 02:26:16
Nit: Adjust -> Adjusts
exceeds -> exceed
| |
52 ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, | |
53 gfx::Rect* bounds); | |
54 | |
50 // Move the given bounds inside the given |visible_area| in parent coordinates, | 55 // Move the given bounds inside the given |visible_area| in parent coordinates, |
51 // including a safety margin given by |kMinimumOnScreenArea|. | 56 // including a safety margin given by |kMinimumOnScreenArea|. |
52 // This also ensures that the top of the bounds is visible. | 57 // This also ensures that the top of the bounds is visible. |
53 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( | 58 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( |
54 const gfx::Rect& visible_area, | 59 const gfx::Rect& visible_area, |
55 gfx::Rect* bounds); | 60 gfx::Rect* bounds); |
56 | 61 |
57 // Move the given bounds inside the given |visible_area| in parent coordinates, | 62 // Move the given bounds inside the given |visible_area| in parent coordinates, |
58 // including a safety margin given by |min_width| and |min_height|. | 63 // including a safety margin given by |min_width| and |min_height|. |
59 // This also ensures that the top of the bounds is visible. | 64 // This also ensures that the top of the bounds is visible. |
(...skipping 18 matching lines...) Expand all Loading... | |
78 // Does not change parent of the transient children that are not themselves | 83 // Does not change parent of the transient children that are not themselves |
79 // children of |old_parent|. | 84 // children of |old_parent|. |
80 void ReparentTransientChildrenOfChild(aura::Window* child, | 85 void ReparentTransientChildrenOfChild(aura::Window* child, |
81 aura::Window* old_parent, | 86 aura::Window* old_parent, |
82 aura::Window* new_parent); | 87 aura::Window* new_parent); |
83 | 88 |
84 } // namespace wm | 89 } // namespace wm |
85 } // namespace ash | 90 } // namespace ash |
86 | 91 |
87 #endif // ASH_WM_WINDOW_UTIL_H_ | 92 #endif // ASH_WM_WINDOW_UTIL_H_ |
OLD | NEW |