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

Side by Side Diff: ash/common/wm_window.h

Issue 2042913002: Converts MruWindowTracker to work with common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not equal 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/common/wm_shell.h ('k') | ash/common/wm_window_observer.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_COMMON_WM_WINDOW_H_ 5 #ifndef ASH_COMMON_WM_WINDOW_H_
6 #define ASH_COMMON_WM_WINDOW_H_ 6 #define ASH_COMMON_WM_WINDOW_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // This class exists as a porting layer to allow ash/wm to work with 47 // This class exists as a porting layer to allow ash/wm to work with
48 // aura::Window or mus::Window. See aura::Window for details on the functions. 48 // aura::Window or mus::Window. See aura::Window for details on the functions.
49 class ASH_EXPORT WmWindow { 49 class ASH_EXPORT WmWindow {
50 public: 50 public:
51 // See comments in SetBoundsInScreen(). 51 // See comments in SetBoundsInScreen().
52 enum class BoundsInScreenBehavior { 52 enum class BoundsInScreenBehavior {
53 USE_LOCAL_COORDINATES, 53 USE_LOCAL_COORDINATES,
54 USE_SCREEN_COORDINATES, 54 USE_SCREEN_COORDINATES,
55 }; 55 };
56 56
57 using Windows = std::vector<WmWindow*>;
58
57 WmWindow* GetRootWindow() { 59 WmWindow* GetRootWindow() {
58 return const_cast<WmWindow*>( 60 return const_cast<WmWindow*>(
59 const_cast<const WmWindow*>(this)->GetRootWindow()); 61 const_cast<const WmWindow*>(this)->GetRootWindow());
60 } 62 }
61 virtual const WmWindow* GetRootWindow() const = 0; 63 virtual const WmWindow* GetRootWindow() const = 0;
62 virtual WmRootWindowController* GetRootWindowController() = 0; 64 virtual WmRootWindowController* GetRootWindowController() = 0;
63 65
64 // TODO(sky): fix constness. 66 // TODO(sky): fix constness.
65 virtual WmShell* GetShell() const = 0; 67 virtual WmShell* GetShell() const = 0;
66 68
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const gfx::Rect& screen_bounds) = 0; 127 const gfx::Rect& screen_bounds) = 0;
126 virtual void AddChild(WmWindow* window) = 0; 128 virtual void AddChild(WmWindow* window) = 0;
127 129
128 virtual WmWindow* GetParent() = 0; 130 virtual WmWindow* GetParent() = 0;
129 131
130 WmWindow* GetTransientParent() { 132 WmWindow* GetTransientParent() {
131 return const_cast<WmWindow*>( 133 return const_cast<WmWindow*>(
132 const_cast<const WmWindow*>(this)->GetTransientParent()); 134 const_cast<const WmWindow*>(this)->GetTransientParent());
133 } 135 }
134 virtual const WmWindow* GetTransientParent() const = 0; 136 virtual const WmWindow* GetTransientParent() const = 0;
135 virtual std::vector<WmWindow*> GetTransientChildren() = 0; 137 virtual Windows GetTransientChildren() = 0;
136 138
137 virtual void SetLayoutManager( 139 virtual void SetLayoutManager(
138 std::unique_ptr<WmLayoutManager> layout_manager) = 0; 140 std::unique_ptr<WmLayoutManager> layout_manager) = 0;
139 virtual WmLayoutManager* GetLayoutManager() = 0; 141 virtual WmLayoutManager* GetLayoutManager() = 0;
140 142
141 // |type| is WindowVisibilityAnimationType. Has to be an int to match aura. 143 // |type| is WindowVisibilityAnimationType. Has to be an int to match aura.
142 virtual void SetVisibilityAnimationType(int type) = 0; 144 virtual void SetVisibilityAnimationType(int type) = 0;
143 virtual void SetVisibilityAnimationDuration(base::TimeDelta delta) = 0; 145 virtual void SetVisibilityAnimationDuration(base::TimeDelta delta) = 0;
144 virtual void SetVisibilityAnimationTransition( 146 virtual void SetVisibilityAnimationTransition(
145 ::wm::WindowVisibilityAnimationTransition transition) = 0; 147 ::wm::WindowVisibilityAnimationTransition transition) = 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 virtual bool CanMaximize() const = 0; 222 virtual bool CanMaximize() const = 0;
221 virtual bool CanMinimize() const = 0; 223 virtual bool CanMinimize() const = 0;
222 virtual bool CanResize() const = 0; 224 virtual bool CanResize() const = 0;
223 virtual bool CanActivate() const = 0; 225 virtual bool CanActivate() const = 0;
224 226
225 virtual void StackChildAtTop(WmWindow* child) = 0; 227 virtual void StackChildAtTop(WmWindow* child) = 0;
226 virtual void StackChildAtBottom(WmWindow* child) = 0; 228 virtual void StackChildAtBottom(WmWindow* child) = 0;
227 virtual void StackChildAbove(WmWindow* child, WmWindow* target) = 0; 229 virtual void StackChildAbove(WmWindow* child, WmWindow* target) = 0;
228 virtual void StackChildBelow(WmWindow* child, WmWindow* target) = 0; 230 virtual void StackChildBelow(WmWindow* child, WmWindow* target) = 0;
229 231
230 virtual std::vector<WmWindow*> GetChildren() = 0; 232 virtual Windows GetChildren() = 0;
231 233
232 // Shows/hides the resize shadow. |component| is the component to show the 234 // Shows/hides the resize shadow. |component| is the component to show the
233 // shadow for (one of the constants in ui/base/hit_test.h). 235 // shadow for (one of the constants in ui/base/hit_test.h).
234 virtual void ShowResizeShadow(int component) = 0; 236 virtual void ShowResizeShadow(int component) = 0;
235 virtual void HideResizeShadow() = 0; 237 virtual void HideResizeShadow() = 0;
236 238
237 // See description in SetBoundsInScreen(). 239 // See description in SetBoundsInScreen().
238 virtual void SetBoundsInScreenBehaviorForChildren(BoundsInScreenBehavior) = 0; 240 virtual void SetBoundsInScreenBehaviorForChildren(BoundsInScreenBehavior) = 0;
239 241
240 // See description of SnapToPixelBoundaryIfNecessary(). 242 // See description of SnapToPixelBoundaryIfNecessary().
(...skipping 14 matching lines...) Expand all
255 virtual void AddObserver(WmWindowObserver* observer) = 0; 257 virtual void AddObserver(WmWindowObserver* observer) = 0;
256 virtual void RemoveObserver(WmWindowObserver* observer) = 0; 258 virtual void RemoveObserver(WmWindowObserver* observer) = 0;
257 259
258 protected: 260 protected:
259 virtual ~WmWindow() {} 261 virtual ~WmWindow() {}
260 }; 262 };
261 263
262 } // namespace ash 264 } // namespace ash
263 265
264 #endif // ASH_COMMON_WM_WINDOW_H_ 266 #endif // ASH_COMMON_WM_WINDOW_H_
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/common/wm_window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698