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

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

Issue 2613793002: Removes/promotes functions from WmWindowMus to WmWindowAura (Closed)
Patch Set: move WmWindowAuraTestApi to ash/test Created 3 years, 11 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 | « no previous file | 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 class WmWindowAuraTestApi;
18
17 // WmWindowAura is tied to the life of the underlying aura::Window. Use the 19 // 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. 20 // static Get() function to obtain a WmWindowAura from an aura::Window.
19 class ASH_EXPORT WmWindowAura : public WmWindow, 21 class ASH_EXPORT WmWindowAura : public WmWindow,
20 public aura::WindowObserver, 22 public aura::WindowObserver,
21 public ::wm::TransientWindowObserver { 23 public ::wm::TransientWindowObserver {
22 public: 24 public:
23 // NOTE: this class is owned by the corresponding window. You shouldn't delete 25 // NOTE: this class is owned by the corresponding window. You shouldn't delete
24 // TODO(sky): friend deleter and make private. 26 // TODO(sky): friend deleter and make private.
25 ~WmWindowAura() override; 27 ~WmWindowAura() override;
26 28
(...skipping 11 matching lines...) Expand all
38 40
39 static aura::Window* GetAuraWindow(WmWindow* wm_window) { 41 static aura::Window* GetAuraWindow(WmWindow* wm_window) {
40 return const_cast<aura::Window*>( 42 return const_cast<aura::Window*>(
41 GetAuraWindow(const_cast<const WmWindow*>(wm_window))); 43 GetAuraWindow(const_cast<const WmWindow*>(wm_window)));
42 } 44 }
43 static const aura::Window* GetAuraWindow(const WmWindow* wm_window); 45 static const aura::Window* GetAuraWindow(const WmWindow* wm_window);
44 46
45 aura::Window* aura_window() { return window_; } 47 aura::Window* aura_window() { return window_; }
46 const aura::Window* aura_window() const { return window_; } 48 const aura::Window* aura_window() const { return window_; }
47 49
50 // See description of |children_use_extended_hit_region_|.
51 bool ShouldUseExtendedHitRegion() const;
52
48 // WmWindow: 53 // WmWindow:
49 void Destroy() override; 54 void Destroy() override;
50 const WmWindow* GetRootWindow() const override; 55 const WmWindow* GetRootWindow() const override;
51 WmRootWindowController* GetRootWindowController() override; 56 WmRootWindowController* GetRootWindowController() override;
52 WmShell* GetShell() const override; 57 WmShell* GetShell() const override;
53 void SetName(const char* name) override; 58 void SetName(const char* name) override;
54 std::string GetName() const override; 59 std::string GetName() const override;
55 void SetTitle(const base::string16& title) override; 60 void SetTitle(const base::string16& title) override;
56 base::string16 GetTitle() const override; 61 base::string16 GetTitle() const override;
57 void SetShellWindowId(int id) override; 62 void SetShellWindowId(int id) override;
58 int GetShellWindowId() const override; 63 int GetShellWindowId() const override;
59 WmWindow* GetChildByShellWindowId(int id) override; 64 WmWindow* GetChildByShellWindowId(int id) override;
60 ui::wm::WindowType GetType() const override; 65 ui::wm::WindowType GetType() const override;
61 int GetAppType() const override; 66 int GetAppType() const override;
62 void SetAppType(int app_type) const override; 67 void SetAppType(int app_type) const override;
63 bool IsBubble() override;
64 ui::Layer* GetLayer() override; 68 ui::Layer* GetLayer() override;
65 bool GetLayerTargetVisibility() override; 69 bool GetLayerTargetVisibility() override;
66 bool GetLayerVisible() override; 70 bool GetLayerVisible() override;
67 display::Display GetDisplayNearestWindow() override; 71 display::Display GetDisplayNearestWindow() override;
68 bool HasNonClientArea() override; 72 bool HasNonClientArea() override;
69 int GetNonClientComponent(const gfx::Point& location) override; 73 int GetNonClientComponent(const gfx::Point& location) override;
70 gfx::Point ConvertPointToTarget(const WmWindow* target, 74 gfx::Point ConvertPointToTarget(const WmWindow* target,
71 const gfx::Point& point) const override; 75 const gfx::Point& point) const override;
72 gfx::Point ConvertPointToScreen(const gfx::Point& point) const override; 76 gfx::Point ConvertPointToScreen(const gfx::Point& point) const override;
73 gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override; 77 gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; 216 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override;
213 void OnWindowTitleChanged(aura::Window* window) override; 217 void OnWindowTitleChanged(aura::Window* window) override;
214 218
215 // ::wm::TransientWindowObserver overrides: 219 // ::wm::TransientWindowObserver overrides:
216 void OnTransientChildAdded(aura::Window* window, 220 void OnTransientChildAdded(aura::Window* window,
217 aura::Window* transient) override; 221 aura::Window* transient) override;
218 void OnTransientChildRemoved(aura::Window* window, 222 void OnTransientChildRemoved(aura::Window* window,
219 aura::Window* transient) override; 223 aura::Window* transient) override;
220 224
221 private: 225 private:
226 friend class WmWindowAuraTestApi;
227
222 aura::Window* window_; 228 aura::Window* window_;
223 229
224 base::ObserverList<WmWindowObserver> observers_; 230 base::ObserverList<WmWindowObserver> observers_;
225 231
226 bool added_transient_observer_ = false; 232 bool added_transient_observer_ = false;
227 base::ObserverList<WmTransientWindowObserver> transient_observers_; 233 base::ObserverList<WmTransientWindowObserver> transient_observers_;
228 234
235 // If true child windows should get a slightly larger hit region to make
236 // resizing easier.
237 bool children_use_extended_hit_region_ = false;
238
239 // Default value for |use_empty_minimum_size_for_testing_|.
240 static bool default_use_empty_minimum_size_for_testing_;
241
242 // If true the minimum size is 0x0, default is minimum size comes from widget.
243 bool use_empty_minimum_size_for_testing_;
244
229 DISALLOW_COPY_AND_ASSIGN(WmWindowAura); 245 DISALLOW_COPY_AND_ASSIGN(WmWindowAura);
230 }; 246 };
231 247
232 } // namespace ash 248 } // namespace ash
233 249
234 #endif // ASH_AURA_WM_WINDOW_AURA_H_ 250 #endif // ASH_AURA_WM_WINDOW_AURA_H_
OLDNEW
« no previous file with comments | « no previous file | ash/aura/wm_window_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698