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

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

Issue 11434004: ash: Refactor some code that snaps windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « ash/wm/toplevel_window_event_handler_unittest.cc ('k') | ash/wm/window_util.cc » ('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 (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 "ash/wm/workspace/snap_sizer.h"
9 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
10 #include "ui/base/ui_base_types.h" 11 #include "ui/base/ui_base_types.h"
11 12
12 namespace aura { 13 namespace aura {
13 class RootWindow; 14 class RootWindow;
14 class Window; 15 class Window;
15 } 16 }
16 17
17 namespace gfx { 18 namespace gfx {
18 class Rect; 19 class Rect;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 78
78 // Restores |window|, which must not be NULL. 79 // Restores |window|, which must not be NULL.
79 ASH_EXPORT void RestoreWindow(aura::Window* window); 80 ASH_EXPORT void RestoreWindow(aura::Window* window);
80 81
81 // Maximizes or restores |window| based on its state. |window| must not be NULL. 82 // Maximizes or restores |window| based on its state. |window| must not be NULL.
82 ASH_EXPORT void ToggleMaximizedWindow(aura::Window* window); 83 ASH_EXPORT void ToggleMaximizedWindow(aura::Window* window);
83 84
84 // Moves the window to the center of the display. 85 // Moves the window to the center of the display.
85 ASH_EXPORT void CenterWindow(aura::Window* window); 86 ASH_EXPORT void CenterWindow(aura::Window* window);
86 87
88 // Snaps a window left or right.
89 ASH_EXPORT void SnapWindow(aura::Window* window,
sky 2012/11/28 22:04:01 In hope of not making this file contain a ton of s
sadrul 2012/11/28 23:20:16 Yep. Sounds good to me. Done.
90 internal::SnapSizer::Edge edge);
91
87 // Returns the existing Layer for |window| (and all its descendants) and creates 92 // Returns the existing Layer for |window| (and all its descendants) and creates
88 // a new layer for |window| and all its descendants. This is intended for 93 // a new layer for |window| and all its descendants. This is intended for
89 // animations that want to animate between the existing visuals and a new window 94 // animations that want to animate between the existing visuals and a new window
90 // state. The caller owns the return value. 95 // state. The caller owns the return value.
91 // 96 //
92 // As a result of this |window| has freshly created layers, meaning the layers 97 // As a result of this |window| has freshly created layers, meaning the layers
93 // are all empty (nothing has been painted to them) and are sized to 0x0. Soon 98 // are all empty (nothing has been painted to them) and are sized to 0x0. Soon
94 // after this call you need to reset the bounds of the window. Or, you can pass 99 // after this call you need to reset the bounds of the window. Or, you can pass
95 // true as the second argument to let the function do that. 100 // true as the second argument to let the function do that.
96 ASH_EXPORT ui::Layer* RecreateWindowLayers(aura::Window* window, 101 ASH_EXPORT ui::Layer* RecreateWindowLayers(aura::Window* window,
(...skipping 27 matching lines...) Expand all
124 129
125 // Move the given bounds inside the given work area, including a safety margin. 130 // Move the given bounds inside the given work area, including a safety margin.
126 ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility( 131 ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility(
127 gfx::Rect* bounds, 132 gfx::Rect* bounds,
128 const gfx::Rect& work_area); 133 const gfx::Rect& work_area);
129 134
130 } // namespace wm 135 } // namespace wm
131 } // namespace ash 136 } // namespace ash
132 137
133 #endif // ASH_WM_WINDOW_UTIL_H_ 138 #endif // ASH_WM_WINDOW_UTIL_H_
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler_unittest.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698