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

Unified Diff: chrome/browser/ui/window_sizer/window_sizer.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (only update size when unmaximizing) Created 6 years, 5 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: chrome/browser/ui/window_sizer/window_sizer.cc
diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc
index 34b342b05985c9642d5765b902271582633b2974..41a47fe81c0d7877af36daa25aa19d5cccbd1aa3 100644
--- a/chrome/browser/ui/window_sizer/window_sizer.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer.cc
@@ -224,6 +224,17 @@ void WindowSizer::GetBrowserWindowBoundsAndShowState(
sizer.DetermineWindowBoundsAndShowState(specified_bounds,
window_bounds,
show_state);
+ if (*show_state == ui::SHOW_STATE_DEFAULT) {
+ gfx::Display display = sizer.GetTargetDisplay(*window_bounds);
+ if (*window_bounds == display.work_area()) {
+ // A window that occupies the whole work area gets maximized.
+ // |window_bounds| returned here become the restore bounds once the window
+ // gets maximized after this method returns. Return a sensible default
+ // in order to make restored state visibly different from maximized.
+ *show_state = ui::SHOW_STATE_MAXIMIZED;
+ sizer.GetDefaultWindowBounds(display, window_bounds);
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698