Index: ash/wm/window_state.h |
diff --git a/ash/wm/window_state.h b/ash/wm/window_state.h |
index 25f52bd126e28e99626d2049c9bf47a043eb6756..a1dcbfb8a2aeafccf4d155fa507ed6c0f2ec6dd0 100644 |
--- a/ash/wm/window_state.h |
+++ b/ash/wm/window_state.h |
@@ -13,12 +13,9 @@ |
#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/observer_list.h" |
+#include "ui/aura/window_observer.h" |
#include "ui/base/ui_base_types.h" |
-namespace aura { |
-class Window; |
-} |
- |
namespace gfx { |
class Rect; |
} |
@@ -26,7 +23,6 @@ class Rect; |
namespace ash { |
class LockWindowState; |
class MaximizeModeWindowState; |
-class WmWindow; |
namespace mojom { |
enum class WindowPinType; |
@@ -58,7 +54,7 @@ ASH_EXPORT const WindowState* GetWindowState(const aura::Window* window); |
// Prefer using this class instead of passing aura::Window* around in |
// ash code as this is often what you need to interact with, and |
// accessing the window using |window()| is cheap. |
-class ASH_EXPORT WindowState { |
+class ASH_EXPORT WindowState : public aura::WindowObserver { |
public: |
// A subclass of State class represents one of the window's states |
// that corresponds to WindowStateType in Ash environment, e.g. |
@@ -92,10 +88,10 @@ class ASH_EXPORT WindowState { |
}; |
// Call GetWindowState() to instantiate this class. |
- virtual ~WindowState(); |
+ ~WindowState() override; |
- WmWindow* window() { return window_; } |
- const WmWindow* window() const { return window_; } |
+ aura::Window* window() { return window_; } |
+ const aura::Window* window() const { return window_; } |
bool HasDelegate() const; |
void SetDelegate(std::unique_ptr<WindowStateDelegate> delegate); |
@@ -154,7 +150,7 @@ class ASH_EXPORT WindowState { |
// Caches, then disables always on top state and then stacks |window_| below |
// |window_on_top| if a |window_| is currently in always on top state. |
- void DisableAlwaysOnTop(WmWindow* window_on_top); |
+ void DisableAlwaysOnTop(aura::Window* window_on_top); |
// Restores always on top state that a window might have cached. |
void RestoreAlwaysOnTop(); |
@@ -327,12 +323,6 @@ class ASH_EXPORT WindowState { |
const DragDetails* drag_details() const { return drag_details_.get(); } |
DragDetails* drag_details() { return drag_details_.get(); } |
- // Called from the associated WmWindow once the show state changes. |
- void OnWindowShowStateChanged(); |
- |
- // Called from the associated WmWindow once the window pin type changes. |
- void OnWindowPinTypeChanged(); |
- |
private: |
friend class DefaultState; |
friend class ash::LockWindowState; |
@@ -342,7 +332,7 @@ class ASH_EXPORT WindowState { |
FRIEND_TEST_ALL_PREFIXES(WindowAnimationsTest, |
CrossFadeToBoundsFromTransform); |
- explicit WindowState(WmWindow* window); |
+ explicit WindowState(aura::Window* window); |
WindowStateDelegate* delegate() { return delegate_.get(); } |
@@ -385,8 +375,13 @@ class ASH_EXPORT WindowState { |
// a cross fade animation. |
void SetBoundsDirectCrossFade(const gfx::Rect& bounds); |
+ // aura::WindowObserver: |
+ void OnWindowPropertyChanged(aura::Window* window, |
+ const void* key, |
+ intptr_t old) override; |
+ |
// The owner of this window settings. |
- WmWindow* window_; |
+ aura::Window* window_; |
std::unique_ptr<WindowStateDelegate> delegate_; |
bool window_position_managed_; |