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

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: Addressed comments Created 7 years, 4 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/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 571a098fc373bb06f7d9f9d95f4f2ba85f88c1ed..09266cec309ad243e5f5fc348d805b65907ea292 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 {

Powered by Google App Engine
This is Rietveld 408576698