Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: ash/wm/common/window_positioning_utils.h

Issue 2018753003: Moves ash/wm/common back into ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove BUILD.gn again Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/common/window_positioner.h ('k') | ash/wm/common/window_resizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_COMMON_WINDOW_POSITIONING_UTILS_H_ 5 #ifndef ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_
6 #define ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ 6 #define ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_
7 7
8 #include "ash/wm/common/ash_wm_common_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 { 16 namespace wm {
17 17
18 class WmWindow; 18 class WmWindow;
19 19
20 // We force at least this many DIPs for any window on the screen. 20 // We force at least this many DIPs for any window on the screen.
21 const int kMinimumOnScreenArea = 25; 21 const int kMinimumOnScreenArea = 25;
22 22
23 // Adjusts |bounds| so that the size does not exceed |max_size|. 23 // Adjusts |bounds| so that the size does not exceed |max_size|.
24 ASH_WM_COMMON_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, 24 ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size,
25 gfx::Rect* bounds); 25 gfx::Rect* bounds);
26 26
27 // Move the given bounds inside the given |visible_area| in parent coordinates, 27 // Move the given bounds inside the given |visible_area| in parent coordinates,
28 // including a safety margin given by |min_width| and |min_height|. 28 // including a safety margin given by |min_width| and |min_height|.
29 // This also ensures that the top of the bounds is visible. 29 // This also ensures that the top of the bounds is visible.
30 ASH_WM_COMMON_EXPORT void AdjustBoundsToEnsureWindowVisibility( 30 ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility(
31 const gfx::Rect& visible_area, 31 const gfx::Rect& visible_area,
32 int min_width, 32 int min_width,
33 int min_height, 33 int min_height,
34 gfx::Rect* bounds); 34 gfx::Rect* bounds);
35 35
36 // Move the given bounds inside the given |visible_area| in parent coordinates, 36 // Move the given bounds inside the given |visible_area| in parent coordinates,
37 // including a safety margin given by |kMinimumOnScreenArea|. 37 // including a safety margin given by |kMinimumOnScreenArea|.
38 // This also ensures that the top of the bounds is visible. 38 // This also ensures that the top of the bounds is visible.
39 ASH_WM_COMMON_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( 39 ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility(
40 const gfx::Rect& visible_area, 40 const gfx::Rect& visible_area,
41 gfx::Rect* bounds); 41 gfx::Rect* bounds);
42 42
43 // Returns the bounds of a left snapped window with default width in parent 43 // Returns the bounds of a left snapped window with default width in parent
44 // coordinates. 44 // coordinates.
45 ASH_WM_COMMON_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( 45 ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(
46 WmWindow* window); 46 WmWindow* window);
47 47
48 // Returns the bounds of a right snapped window with default width in parent 48 // Returns the bounds of a right snapped window with default width in parent
49 // coordinates. 49 // coordinates.
50 ASH_WM_COMMON_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( 50 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(
51 WmWindow* window); 51 WmWindow* window);
52 52
53 } // namespace wm 53 } // namespace wm
54 } // namespace ash 54 } // namespace ash
55 55
56 #endif // ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ 56 #endif // ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_
OLDNEW
« no previous file with comments | « ash/wm/common/window_positioner.h ('k') | ash/wm/common/window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698