Index: ui/views/bubble/bubble_dialog_delegate.cc |
diff --git a/ui/views/bubble/bubble_dialog_delegate.cc b/ui/views/bubble/bubble_dialog_delegate.cc |
index b8be537b9912cb78562f726d0e441f52bab0c8e4..9a19c4197b96567c0aefc6a546549874378bffb1 100644 |
--- a/ui/views/bubble/bubble_dialog_delegate.cc |
+++ b/ui/views/bubble/bubble_dialog_delegate.cc |
@@ -106,9 +106,6 @@ ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) { |
NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView( |
Widget* widget) { |
BubbleFrameView* frame = new BubbleFrameView(title_margins_, margins_); |
- // Note: In CreateBubble, the call to SizeToContents() will cause |
- // the relayout that this call requires. |
- frame->SetTitleFontList(GetTitleFontList()); |
frame->SetFootnoteView(CreateFootnoteView()); |
BubbleBorder::Arrow adjusted_arrow = arrow(); |
@@ -123,6 +120,10 @@ const char* BubbleDialogDelegateView::GetClassName() const { |
return kViewClassName; |
} |
+void BubbleDialogDelegateView::AddedToWidget() { |
+ SetupTitleView(); |
+} |
+ |
void BubbleDialogDelegateView::OnWidgetDestroying(Widget* widget) { |
if (anchor_widget() == widget) |
SetAnchorView(NULL); |
@@ -234,11 +235,15 @@ gfx::Rect BubbleDialogDelegateView::GetBubbleBounds() { |
adjust_if_offscreen_ && !anchor_minimized); |
} |
-const gfx::FontList& BubbleDialogDelegateView::GetTitleFontList() const { |
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
- if (ui::MaterialDesignController::IsSecondaryUiMaterial()) |
- return rb.GetFontListWithDelta(ui::kTitleFontSizeDelta); |
- return rb.GetFontList(ui::ResourceBundle::MediumFont); |
+View* BubbleDialogDelegateView::CreateTitleView( |
+ const base::string16& title_text) { |
+ return nullptr; |
+} |
+ |
+void BubbleDialogDelegateView::SetupTitleView() { |
+ View* title_view = CreateTitleView(GetWindowTitle()); |
+ if (title_view) |
+ GetBubbleFrameView()->SetTitleView(title_view); |
} |
void BubbleDialogDelegateView::OnNativeThemeChanged( |