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

Side by Side Diff: ash/aura/wm_window_aura.h

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: add overrides Created 4 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
« no previous file with comments | « ash/aura/wm_root_window_controller_aura.cc ('k') | ash/aura/wm_window_aura.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_AURA_WM_WINDOW_AURA_H_ 5 #ifndef ASH_AURA_WM_WINDOW_AURA_H_
6 #define ASH_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_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 #include "ui/wm/core/transient_window_observer.h" 13 #include "ui/wm/core/transient_window_observer.h"
14 14
15 namespace ash { 15 namespace ash {
16 16
17 // WmWindowAura is tied to the life of the underlying aura::Window. 17 // WmWindowAura is tied to the life of the underlying aura::Window. Use the
18 // static Get() function to obtain a WmWindowAura from an aura::Window.
18 class ASH_EXPORT WmWindowAura : public WmWindow, 19 class ASH_EXPORT WmWindowAura : public WmWindow,
19 public aura::WindowObserver, 20 public aura::WindowObserver,
20 public ::wm::TransientWindowObserver { 21 public ::wm::TransientWindowObserver {
21 public: 22 public:
22 explicit WmWindowAura(aura::Window* window);
23 // NOTE: this class is owned by the corresponding window. You shouldn't delete 23 // NOTE: this class is owned by the corresponding window. You shouldn't delete
24 // TODO(sky): friend deleter and make private. 24 // TODO(sky): friend deleter and make private.
25 ~WmWindowAura() override; 25 ~WmWindowAura() override;
26 26
27 // Returns a WmWindow for an aura::Window, creating if necessary. |window| may 27 // Returns a WmWindow for an aura::Window, creating if necessary. |window| may
28 // be null, in which case null is returned. 28 // be null, in which case null is returned.
29 static WmWindow* Get(aura::Window* window) { 29 static WmWindow* Get(aura::Window* window) {
30 return const_cast<WmWindow*>(Get(const_cast<const aura::Window*>(window))); 30 return const_cast<WmWindow*>(Get(const_cast<const aura::Window*>(window)));
31 } 31 }
32 static const WmWindow* Get(const aura::Window* window); 32 static const WmWindow* Get(const aura::Window* window);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 std::unique_ptr<views::View> CreateViewWithRecreatedLayers() override; 181 std::unique_ptr<views::View> CreateViewWithRecreatedLayers() override;
182 void AddObserver(WmWindowObserver* observer) override; 182 void AddObserver(WmWindowObserver* observer) override;
183 void RemoveObserver(WmWindowObserver* observer) override; 183 void RemoveObserver(WmWindowObserver* observer) override;
184 bool HasObserver(const WmWindowObserver* observer) const override; 184 bool HasObserver(const WmWindowObserver* observer) const override;
185 void AddTransientWindowObserver(WmTransientWindowObserver* observer) override; 185 void AddTransientWindowObserver(WmTransientWindowObserver* observer) override;
186 void RemoveTransientWindowObserver( 186 void RemoveTransientWindowObserver(
187 WmTransientWindowObserver* observer) override; 187 WmTransientWindowObserver* observer) override;
188 void AddLimitedPreTargetHandler(ui::EventHandler* handler) override; 188 void AddLimitedPreTargetHandler(ui::EventHandler* handler) override;
189 void RemoveLimitedPreTargetHandler(ui::EventHandler* handler) override; 189 void RemoveLimitedPreTargetHandler(ui::EventHandler* handler) override;
190 190
191 private: 191 protected:
192 explicit WmWindowAura(aura::Window* window);
193
194 // Returns true if a WmWindowAura has been created for |window|.
195 static bool HasInstance(const aura::Window* window);
196
197 base::ObserverList<WmWindowObserver>& observers() { return observers_; }
198
192 // aura::WindowObserver: 199 // aura::WindowObserver:
193 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; 200 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override;
194 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; 201 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override;
195 void OnWindowStackingChanged(aura::Window* window) override; 202 void OnWindowStackingChanged(aura::Window* window) override;
196 void OnWindowPropertyChanged(aura::Window* window, 203 void OnWindowPropertyChanged(aura::Window* window,
197 const void* key, 204 const void* key,
198 intptr_t old) override; 205 intptr_t old) override;
199 void OnWindowBoundsChanged(aura::Window* window, 206 void OnWindowBoundsChanged(aura::Window* window,
200 const gfx::Rect& old_bounds, 207 const gfx::Rect& old_bounds,
201 const gfx::Rect& new_bounds) override; 208 const gfx::Rect& new_bounds) override;
202 void OnWindowDestroying(aura::Window* window) override; 209 void OnWindowDestroying(aura::Window* window) override;
203 void OnWindowDestroyed(aura::Window* window) override; 210 void OnWindowDestroyed(aura::Window* window) override;
204 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; 211 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override;
205 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; 212 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override;
206 void OnWindowTitleChanged(aura::Window* window) override; 213 void OnWindowTitleChanged(aura::Window* window) override;
207 214
208 // ::wm::TransientWindowObserver overrides: 215 // ::wm::TransientWindowObserver overrides:
209 void OnTransientChildAdded(aura::Window* window, 216 void OnTransientChildAdded(aura::Window* window,
210 aura::Window* transient) override; 217 aura::Window* transient) override;
211 void OnTransientChildRemoved(aura::Window* window, 218 void OnTransientChildRemoved(aura::Window* window,
212 aura::Window* transient) override; 219 aura::Window* transient) override;
213 220
221 private:
214 aura::Window* window_; 222 aura::Window* window_;
215 223
216 base::ObserverList<WmWindowObserver> observers_; 224 base::ObserverList<WmWindowObserver> observers_;
217 225
218 bool added_transient_observer_ = false; 226 bool added_transient_observer_ = false;
219 base::ObserverList<WmTransientWindowObserver> transient_observers_; 227 base::ObserverList<WmTransientWindowObserver> transient_observers_;
220 228
221 DISALLOW_COPY_AND_ASSIGN(WmWindowAura); 229 DISALLOW_COPY_AND_ASSIGN(WmWindowAura);
222 }; 230 };
223 231
224 } // namespace ash 232 } // namespace ash
225 233
226 #endif // ASH_AURA_WM_WINDOW_AURA_H_ 234 #endif // ASH_AURA_WM_WINDOW_AURA_H_
OLDNEW
« no previous file with comments | « ash/aura/wm_root_window_controller_aura.cc ('k') | ash/aura/wm_window_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698