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

Unified Diff: views/widget/native_widget_gtk.cc

Issue 7748036: Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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: views/widget/native_widget_gtk.cc
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index 75778c9216a4423a18ff41c47a189d2da1780148..9b640611195e305b94af503138d7013b0ceb26d1 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -1003,8 +1003,9 @@ void NativeWidgetGtk::CenterWindow(const gfx::Size& size) {
SetBoundsConstrained(bounds, NULL);
}
-void NativeWidgetGtk::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds,
- bool* maximized) const {
+void NativeWidgetGtk::GetWindowBoundsAndShowState(
+ gfx::Rect* bounds,
+ ui::WindowShowState* show_state) const {
// Do nothing for now. ChromeOS isn't yet saving window placement.
}
@@ -1185,9 +1186,9 @@ void NativeWidgetGtk::ShowMaximizedWithBounds(
Show();
}
-void NativeWidgetGtk::ShowWithState(ShowState state) {
+void NativeWidgetGtk::ShowWithWindowState(ui::WindowShowState show_state) {
// No concept of maximization (yet) on ChromeOS.
- if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE)
+ if (show_state == ui::SHOW_STATE_INACTIVE)
gtk_window_set_focus_on_map(GetNativeWindow(), false);
gtk_widget_show(GetNativeView());
}
@@ -2075,10 +2076,14 @@ void NativeWidgetGtk::SaveWindowPosition() {
if (!GetWidget()->widget_delegate())
return;
- bool maximized = window_state_ & GDK_WINDOW_STATE_MAXIMIZED;
+ ui::WindowShowState show_state = ui::SHOW_STATE_NORMAL;
+ if (IsMaximized())
+ show_state = ui::SHOW_STATE_MAXIMIZED;
+ else if (IsMinimized())
+ show_state = ui::SHOW_STATE_MINIMIZED;
GetWidget()->widget_delegate()->SaveWindowPlacement(
GetWidget()->GetWindowScreenBounds(),
- maximized);
+ show_state);
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698