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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 434343004: Call OnNativeWindowChanged after maximizing and restoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698