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

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

Issue 10883069: Added restore functionality for maximize full/left/right (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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 96c9e58c484289d94d6acfa8a7b71047a3caa11c..331dabf0a685175b205819f48c5e2ce712f11cf4 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -585,7 +585,18 @@ bool NativeWidgetAura::IsMinimized() const {
}
void NativeWidgetAura::Restore() {
- window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ gfx::Rect* restore_bounds =
+ window_->GetProperty(aura::client::kRestoreBoundsKey);
+ // If the windows state is already normal, but there is a restore bounds
+ // stored, we might are on Left/Right maximize mode and only need to restore
+ if (restore_bounds && !IsMinimized() && !IsMaximized() && !IsFullscreen()) {
+ // Since there is a restore bound, but no extreme state set, this has to be
+ // a L/R maximized mode restore.
+ SetBounds(*restore_bounds);
+ window_->ClearProperty(aura::client::kRestoreBoundsKey);
+ } else {
+ window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ }
}
void NativeWidgetAura::SetFullscreen(bool fullscreen) {

Powered by Google App Engine
This is Rietveld 408576698