| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |