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

Unified Diff: chrome/browser/ui/views/frame/browser_view_layout.cc

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No initializer Created 7 years, 3 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 | « chrome/browser/ui/views/constrained_window_views_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view_layout.cc
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index 70e63c9ccf6fa6cfc2201b44925a8f3b700b898d..63e18471ddbd54166dfa02d0ae785d26d6e489b6 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -99,6 +99,20 @@ class BrowserViewLayout::WebContentsModalDialogHostViews
return gfx::Point(middle_x - size.width() / 2, top_y);
}
+ virtual gfx::Size GetMaximumDialogSize() OVERRIDE {
+ gfx::Rect content_area =
+ browser_view_layout_->contents_container_->ConvertRectToWidget(
+ browser_view_layout_->contents_container_->GetLocalBounds());
+
+ gfx::Size max_dialog_size = content_area.size();
+ // Adjust for difference in alignment between the dialog top and the top of
+ // the content area.
+ int height_offset = content_area.y() -
+ browser_view_layout_->web_contents_modal_dialog_top_y_;
+ max_dialog_size.Enlarge(0, height_offset);
+ return max_dialog_size;
+ }
+
// Add/remove observer.
virtual void AddObserver(
WebContentsModalDialogHostObserver* observer) OVERRIDE {
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698