| 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..dca1bc4b85b09937c67b26ee7962d894869c5927 100644
|
| --- a/ui/views/bubble/bubble_frame_view.cc
|
| +++ b/ui/views/bubble/bubble_frame_view.cc
|
| @@ -168,18 +168,11 @@ 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());
|
| - // Accommodate the width of the title bar elements.
|
| - int title_bar_width = GetInsets().width() + border()->GetInsets().width();
|
| - if (!title_->text().empty())
|
| - title_bar_width += kTitleLeftInset + title_->GetPreferredSize().width();
|
| - if (close_->visible())
|
| - title_bar_width += close_->width() + 1;
|
| - if (titlebar_extra_view_ != NULL)
|
| - title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
|
| - size.SetToMax(gfx::Size(title_bar_width, 0));
|
| - return size;
|
| + return GetSizeForClientSize(GetWidget()->client_view()->GetPreferredSize());
|
| +}
|
| +
|
| +gfx::Size BubbleFrameView::GetMinimumSize() {
|
| + return GetSizeForClientSize(GetWidget()->client_view()->GetMinimumSize());
|
| }
|
|
|
| void BubbleFrameView::Layout() {
|
| @@ -334,4 +327,19 @@ void BubbleFrameView::OffsetArrowIfOffScreen(const gfx::Rect& anchor_rect,
|
| SchedulePaint();
|
| }
|
|
|
| +gfx::Size BubbleFrameView::GetSizeForClientSize(const gfx::Size& client_size) {
|
| + 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())
|
| + title_bar_width += kTitleLeftInset + title_->GetPreferredSize().width();
|
| + if (close_->visible())
|
| + title_bar_width += close_->width() + 1;
|
| + if (titlebar_extra_view_ != NULL)
|
| + title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
|
| + size.SetToMax(gfx::Size(title_bar_width, 0));
|
| + return size;
|
| +}
|
| +
|
| } // namespace views
|
|
|