Index: ui/views/widget/native_widget_aura.cc |
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc |
index e57a4ff0bc0ecb56c12fba415058f0d60a13b85f..53c66ddb2b5ac804cfb3c8264e6095d0428cb764 100644 |
--- a/ui/views/widget/native_widget_aura.cc |
+++ b/ui/views/widget/native_widget_aura.cc |
@@ -157,6 +157,9 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { |
window_, context->GetRootWindow(), window_bounds); |
} |
+ // Start observing property changes. |
+ window_->AddObserver(this); |
+ |
// Wait to set the bounds until we have a parent. That way we can know our |
// true state/bounds (the LayoutManager may enforce a particular |
// state/bounds). |
@@ -798,6 +801,7 @@ void NativeWidgetAura::OnDeviceScaleFactorChanged(float device_scale_factor) { |
} |
void NativeWidgetAura::OnWindowDestroying(aura::Window* window) { |
+ window_->RemoveObserver(this); |
delegate_->OnNativeWidgetDestroying(); |
// If the aura::Window is destroyed, we can no longer show tooltips. |
@@ -825,6 +829,16 @@ void NativeWidgetAura::GetHitTestMask(gfx::Path* mask) const { |
} |
//////////////////////////////////////////////////////////////////////////////// |
+// NativeWidgetAura, aura::WindowObserver implementation: |
+ |
+void NativeWidgetAura::OnWindowPropertyChanged(aura::Window* window, |
+ const void* key, |
+ intptr_t old) { |
+ if (key == aura::client::kShowStateKey) |
+ delegate_->OnNativeWidgetWindowShowStateChanged(); |
+} |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
// NativeWidgetAura, ui::EventHandler implementation: |
void NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) { |