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_WM_AURA_WM_WINDOW_AURA_H_ | 5 #ifndef ASH_AURA_WM_WINDOW_AURA_H_ |
6 #define ASH_WM_AURA_WM_WINDOW_AURA_H_ | 6 #define ASH_AURA_WM_WINDOW_AURA_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/common/wm/wm_window.h" | 9 #include "ash/common/wm_window.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 namespace wm { | |
16 | 15 |
17 // WmWindowAura is tied to the life of the underlying aura::Window. | 16 // WmWindowAura is tied to the life of the underlying aura::Window. |
18 class ASH_EXPORT WmWindowAura : public WmWindow, public aura::WindowObserver { | 17 class ASH_EXPORT WmWindowAura : public WmWindow, public aura::WindowObserver { |
19 public: | 18 public: |
20 explicit WmWindowAura(aura::Window* window); | 19 explicit WmWindowAura(aura::Window* window); |
21 // NOTE: this class is owned by the corresponding window. You shouldn't delete | 20 // NOTE: this class is owned by the corresponding window. You shouldn't delete |
22 // TODO(sky): friend deleter and make private. | 21 // TODO(sky): friend deleter and make private. |
23 ~WmWindowAura() override; | 22 ~WmWindowAura() override; |
24 | 23 |
25 // Returns a WmWindow for an aura::Window, creating if necessary. |window| may | 24 // Returns a WmWindow for an aura::Window, creating if necessary. |window| may |
(...skipping 11 matching lines...) Expand all Loading... |
37 GetAuraWindow(const_cast<const WmWindow*>(wm_window))); | 36 GetAuraWindow(const_cast<const WmWindow*>(wm_window))); |
38 } | 37 } |
39 static const aura::Window* GetAuraWindow(const WmWindow* wm_window); | 38 static const aura::Window* GetAuraWindow(const WmWindow* wm_window); |
40 | 39 |
41 aura::Window* aura_window() { return window_; } | 40 aura::Window* aura_window() { return window_; } |
42 const aura::Window* aura_window() const { return window_; } | 41 const aura::Window* aura_window() const { return window_; } |
43 | 42 |
44 // WmWindow: | 43 // WmWindow: |
45 const WmWindow* GetRootWindow() const override; | 44 const WmWindow* GetRootWindow() const override; |
46 WmRootWindowController* GetRootWindowController() override; | 45 WmRootWindowController* GetRootWindowController() override; |
47 WmGlobals* GetGlobals() const override; | 46 WmShell* GetShell() const override; |
48 void SetName(const char* name) override; | 47 void SetName(const char* name) override; |
49 base::string16 GetTitle() const override; | 48 base::string16 GetTitle() const override; |
50 void SetShellWindowId(int id) override; | 49 void SetShellWindowId(int id) override; |
51 int GetShellWindowId() const override; | 50 int GetShellWindowId() const override; |
52 WmWindow* GetChildByShellWindowId(int id) override; | 51 WmWindow* GetChildByShellWindowId(int id) override; |
53 ui::wm::WindowType GetType() const override; | 52 ui::wm::WindowType GetType() const override; |
54 ui::Layer* GetLayer() override; | 53 ui::Layer* GetLayer() override; |
55 display::Display GetDisplayNearestWindow() override; | 54 display::Display GetDisplayNearestWindow() override; |
56 bool HasNonClientArea() override; | 55 bool HasNonClientArea() override; |
57 int GetNonClientComponent(const gfx::Point& location) override; | 56 int GetNonClientComponent(const gfx::Point& location) override; |
58 gfx::Point ConvertPointToTarget(const WmWindow* target, | 57 gfx::Point ConvertPointToTarget(const WmWindow* target, |
59 const gfx::Point& point) const override; | 58 const gfx::Point& point) const override; |
60 gfx::Point ConvertPointToScreen(const gfx::Point& point) const override; | 59 gfx::Point ConvertPointToScreen(const gfx::Point& point) const override; |
61 gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override; | 60 gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override; |
62 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override; | 61 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override; |
63 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const override; | 62 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const override; |
64 gfx::Size GetMinimumSize() const override; | 63 gfx::Size GetMinimumSize() const override; |
65 gfx::Size GetMaximumSize() const override; | 64 gfx::Size GetMaximumSize() const override; |
66 bool GetTargetVisibility() const override; | 65 bool GetTargetVisibility() const override; |
67 bool IsVisible() const override; | 66 bool IsVisible() const override; |
68 void SetOpacity(float opacity) override; | 67 void SetOpacity(float opacity) override; |
69 float GetTargetOpacity() const override; | 68 float GetTargetOpacity() const override; |
70 void SetTransform(const gfx::Transform& transform) override; | 69 void SetTransform(const gfx::Transform& transform) override; |
71 gfx::Transform GetTargetTransform() const override; | 70 gfx::Transform GetTargetTransform() const override; |
72 bool IsSystemModal() const override; | 71 bool IsSystemModal() const override; |
73 bool GetBoolProperty(WmWindowProperty key) override; | 72 bool GetBoolProperty(WmWindowProperty key) override; |
74 int GetIntProperty(WmWindowProperty key) override; | 73 int GetIntProperty(WmWindowProperty key) override; |
75 const WindowState* GetWindowState() const override; | 74 const wm::WindowState* GetWindowState() const override; |
76 WmWindow* GetToplevelWindow() override; | 75 WmWindow* GetToplevelWindow() override; |
77 void SetParentUsingContext(WmWindow* context, | 76 void SetParentUsingContext(WmWindow* context, |
78 const gfx::Rect& screen_bounds) override; | 77 const gfx::Rect& screen_bounds) override; |
79 void AddChild(WmWindow* window) override; | 78 void AddChild(WmWindow* window) override; |
80 WmWindow* GetParent() override; | 79 WmWindow* GetParent() override; |
81 const WmWindow* GetTransientParent() const override; | 80 const WmWindow* GetTransientParent() const override; |
82 std::vector<WmWindow*> GetTransientChildren() override; | 81 std::vector<WmWindow*> GetTransientChildren() override; |
83 void SetLayoutManager( | 82 void SetLayoutManager( |
84 std::unique_ptr<WmLayoutManager> layout_manager) override; | 83 std::unique_ptr<WmLayoutManager> layout_manager) override; |
85 WmLayoutManager* GetLayoutManager() override; | 84 WmLayoutManager* GetLayoutManager() override; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; | 161 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; |
163 void OnWindowTitleChanged(aura::Window* window) override; | 162 void OnWindowTitleChanged(aura::Window* window) override; |
164 | 163 |
165 aura::Window* window_; | 164 aura::Window* window_; |
166 | 165 |
167 base::ObserverList<WmWindowObserver> observers_; | 166 base::ObserverList<WmWindowObserver> observers_; |
168 | 167 |
169 DISALLOW_COPY_AND_ASSIGN(WmWindowAura); | 168 DISALLOW_COPY_AND_ASSIGN(WmWindowAura); |
170 }; | 169 }; |
171 | 170 |
172 } // namespace wm | |
173 } // namespace ash | 171 } // namespace ash |
174 | 172 |
175 #endif // ASH_WM_AURA_WM_WINDOW_AURA_H_ | 173 #endif // ASH_AURA_WM_WINDOW_AURA_H_ |
OLD | NEW |