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); |
} |
} |