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

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

Issue 1900443002: Removes aura dependencies from WindowPositioner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke GetWorkAreaForWindowInParent and fix windows Created 4 years, 8 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/wm_root_window_controller.h ('k') | ash/wm/default_state.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 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_WM_WINDOW_H_ 5 #ifndef ASH_WM_COMMON_WM_WINDOW_H_
6 #define ASH_WM_COMMON_WM_WINDOW_H_ 6 #define ASH_WM_COMMON_WM_WINDOW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "base/time/time.h"
11 #include "ui/base/ui_base_types.h" 12 #include "ui/base/ui_base_types.h"
12 #include "ui/wm/public/window_types.h" 13 #include "ui/wm/public/window_types.h"
13 14
14 namespace gfx { 15 namespace gfx {
15 class Display; 16 class Display;
16 class Point; 17 class Point;
17 class Rect; 18 class Rect;
18 class Size; 19 class Size;
19 } 20 }
20 21
21 namespace ui { 22 namespace ui {
22 class Layer; 23 class Layer;
23 } 24 }
24 25
25 namespace ash { 26 namespace ash {
26 namespace wm { 27 namespace wm {
27 28
28 class WMEvent; 29 class WMEvent;
30 class WmGlobals;
29 class WmRootWindowController; 31 class WmRootWindowController;
30 class WmWindowObserver; 32 class WmWindowObserver;
31 enum class WmWindowProperty; 33 enum class WmWindowProperty;
32 class WindowState; 34 class WindowState;
33 35
34 // This class exists as a porting layer to allow ash/wm to work with 36 // This class exists as a porting layer to allow ash/wm to work with
35 // aura::Window 37 // aura::Window
36 // or mus::Window. See aura::Window for details on the functions. 38 // or mus::Window. See aura::Window for details on the functions.
37 class ASH_EXPORT WmWindow { 39 class ASH_EXPORT WmWindow {
38 public: 40 public:
39 WmWindow* GetRootWindow() { 41 WmWindow* GetRootWindow() {
40 return const_cast<WmWindow*>( 42 return const_cast<WmWindow*>(
41 const_cast<const WmWindow*>(this)->GetRootWindow()); 43 const_cast<const WmWindow*>(this)->GetRootWindow());
42 } 44 }
43 virtual const WmWindow* GetRootWindow() const = 0; 45 virtual const WmWindow* GetRootWindow() const = 0;
44 virtual WmRootWindowController* GetRootWindowController() = 0; 46 virtual WmRootWindowController* GetRootWindowController() = 0;
45 47
48 // TODO(sky): fix constness.
49 virtual WmGlobals* GetGlobals() const = 0;
50
46 virtual int GetShellWindowId() = 0; 51 virtual int GetShellWindowId() = 0;
47 virtual WmWindow* GetChildByShellWindowId(int id) = 0; 52 virtual WmWindow* GetChildByShellWindowId(int id) = 0;
48 53
49 virtual ui::wm::WindowType GetType() const = 0; 54 virtual ui::wm::WindowType GetType() const = 0;
50 55
51 // TODO(sky): seems like this shouldn't be exposed. 56 // TODO(sky): seems like this shouldn't be exposed.
52 virtual ui::Layer* GetLayer() = 0; 57 virtual ui::Layer* GetLayer() = 0;
53 58
54 virtual gfx::Display GetDisplayNearestWindow() = 0; 59 virtual gfx::Display GetDisplayNearestWindow() = 0;
55 60
(...skipping 12 matching lines...) Expand all
68 73
69 // Returns the visibility requested by this window. IsVisible() takes into 74 // Returns the visibility requested by this window. IsVisible() takes into
70 // account the visibility of the layer and ancestors, where as this tracks 75 // account the visibility of the layer and ancestors, where as this tracks
71 // whether Show() without a Hide() has been invoked. 76 // whether Show() without a Hide() has been invoked.
72 virtual bool GetTargetVisibility() const = 0; 77 virtual bool GetTargetVisibility() const = 0;
73 78
74 virtual bool IsVisible() const = 0; 79 virtual bool IsVisible() const = 0;
75 80
76 virtual bool GetBoolProperty(WmWindowProperty key) = 0; 81 virtual bool GetBoolProperty(WmWindowProperty key) = 0;
77 82
78 virtual WindowState* GetWindowState() = 0; 83 WindowState* GetWindowState() {
84 return const_cast<WindowState*>(
85 const_cast<const WmWindow*>(this)->GetWindowState());
86 }
87 virtual const WindowState* GetWindowState() const = 0;
79 88
80 virtual WmWindow* GetToplevelWindow() = 0; 89 virtual WmWindow* GetToplevelWindow() = 0;
81 90
82 virtual WmWindow* GetParent() = 0; 91 virtual WmWindow* GetParent() = 0;
83 92
84 virtual WmWindow* GetTransientParent() = 0; 93 virtual WmWindow* GetTransientParent() = 0;
94 virtual std::vector<WmWindow*> GetTransientChildren() = 0;
85 95
86 virtual void SetBounds(const gfx::Rect& bounds) = 0; 96 virtual void SetBounds(const gfx::Rect& bounds) = 0;
97 virtual void SetBoundsWithTransitionDelay(const gfx::Rect& bounds,
98 base::TimeDelta delta) = 0;
87 // Sets the bounds in such a way that LayoutManagers are circumvented. 99 // Sets the bounds in such a way that LayoutManagers are circumvented.
88 virtual void SetBoundsDirect(const gfx::Rect& bounds) = 0; 100 virtual void SetBoundsDirect(const gfx::Rect& bounds) = 0;
89 virtual void SetBoundsDirectAnimated(const gfx::Rect& bounds) = 0; 101 virtual void SetBoundsDirectAnimated(const gfx::Rect& bounds) = 0;
90 virtual void SetBoundsDirectCrossFade(const gfx::Rect& bounds) = 0; 102 virtual void SetBoundsDirectCrossFade(const gfx::Rect& bounds) = 0;
91 virtual void SetBoundsInScreen(const gfx::Rect& bounds_in_screen, 103 virtual void SetBoundsInScreen(const gfx::Rect& bounds_in_screen,
92 const gfx::Display& dst_display) = 0; 104 const gfx::Display& dst_display) = 0;
93 virtual gfx::Rect GetBoundsInScreen() const = 0; 105 virtual gfx::Rect GetBoundsInScreen() const = 0;
94 virtual const gfx::Rect& GetBounds() const = 0; 106 virtual const gfx::Rect& GetBounds() const = 0;
95 virtual gfx::Rect GetTargetBounds() = 0; 107 virtual gfx::Rect GetTargetBounds() = 0;
96 108
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 virtual void RemoveObserver(WmWindowObserver* observer) = 0; 152 virtual void RemoveObserver(WmWindowObserver* observer) = 0;
141 153
142 protected: 154 protected:
143 virtual ~WmWindow() {} 155 virtual ~WmWindow() {}
144 }; 156 };
145 157
146 } // namespace wm 158 } // namespace wm
147 } // namespace ash 159 } // namespace ash
148 160
149 #endif // ASH_WM_COMMON_WM_WINDOW_H_ 161 #endif // ASH_WM_COMMON_WM_WINDOW_H_
OLDNEW
« no previous file with comments | « ash/wm/common/wm_root_window_controller.h ('k') | ash/wm/default_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698