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

Unified Diff: ui/views/bubble/bubble_frame_view.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
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 2bd579d79d958067b35b74627a189f297f84aab7..c85a0d7fb2753e479ca7e15d0adf05516a722e41 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -168,8 +168,16 @@ gfx::Insets BubbleFrameView::GetInsets() const {
}
gfx::Size BubbleFrameView::GetPreferredSize() {
- const gfx::Size client(GetWidget()->client_view()->GetPreferredSize());
- gfx::Size size(GetUpdatedWindowBounds(gfx::Rect(), client, false).size());
+ return GetSizeForClientSize(GetWidget()->client_view()->GetPreferredSize());
+}
+
+gfx::Size BubbleFrameView::GetMinimumSize() {
+ return GetSizeForClientSize(GetWidget()->client_view()->GetMinimumSize());
+}
+
+gfx::Size BubbleFrameView::GetSizeForClientSize(const gfx::Size& client_size) {
msw 2013/08/23 19:57:25 nit: Move this function to match the declaration o
Rune Fevang 2013/08/23 20:17:45 Done.
+ gfx::Size size(
+ GetUpdatedWindowBounds(gfx::Rect(), client_size, false).size());
// Accommodate the width of the title bar elements.
int title_bar_width = GetInsets().width() + border()->GetInsets().width();
if (!title_->text().empty())
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698