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

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

Issue 10091008: Zzipping windows into the work area upon creation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now including unit tests Created 8 years, 8 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 | « no previous file | chrome/browser/ui/window_sizer_ash_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/window_sizer.cc
diff --git a/chrome/browser/ui/window_sizer.cc b/chrome/browser/ui/window_sizer.cc
index 0f7ed40413e475ef203aceebeb4b0199526a559d..5c2da7f9324509022f90967461d02652aeef3fed 100644
--- a/chrome/browser/ui/window_sizer.cc
+++ b/chrome/browser/ui/window_sizer.cc
@@ -171,6 +171,17 @@ void WindowSizer::DetermineWindowBounds(const gfx::Rect& specified_bounds,
GetDefaultWindowBounds(bounds);
}
}
+ } else {
+ // In case that there was a bound given we need to make sure that it is
+ // visible and fits on the screen.
+ // Find the size of the work area of the monitor that intersects the bounds
+ // of the anchor window. Note: AdjustBoundsToBeVisibleOnMonitorContaining
+ // does not exactly what we want: It makes only sure that "a minimal part"
+ // is visible on the screen.
+ gfx::Rect work_area =
+ monitor_info_provider_->GetMonitorWorkAreaMatching(*bounds);
+ // Resize so that it fits.
+ *bounds = bounds->AdjustToFit(work_area);
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/window_sizer_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698