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

Side by Side Diff: ash/wm/window_util.h

Issue 161293003: Add test case for updating the bounds of snapped window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/wm/window_util.cc » ('j') | ash/wm/window_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_util.cc » ('j') | ash/wm/window_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698