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

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 (added a test) 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..7cdf769355f41ca2d7a595ee922af8d75095d81d 100644
--- a/chrome/browser/ui/window_sizer/window_sizer.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer.cc
@@ -224,6 +224,13 @@ void WindowSizer::GetBrowserWindowBoundsAndShowState(
sizer.DetermineWindowBoundsAndShowState(specified_bounds,
window_bounds,
show_state);
+ if (*show_state == ui::SHOW_STATE_DEFAULT) {
msw 2014/07/30 05:46:37 Can you add unit tests for this new behavior, simi
varkha 2014/07/30 21:03:15 Done.
+ gfx::Display display = sizer.GetTargetDisplay(*window_bounds);
+ if (*window_bounds == display.work_area()) {
+ *show_state = ui::SHOW_STATE_MAXIMIZED;
+ sizer.GetDefaultWindowBounds(display, window_bounds);
msw 2014/07/30 05:46:37 Why do you need to set |window_bounds| to the defa
varkha 2014/07/30 21:03:15 Yes, the bounds returned here become the restore b
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698