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

Unified Diff: ui/views/bubble/bubble_dialog_delegate.cc

Issue 2907983002: Allow dialogs to use a custom View as their title. (Closed)
Patch Set: WIP: second iteration Created 3 years, 6 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: 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..391d8cdb5ac154cf254192da65530541c5363c8c 100644
--- a/ui/views/bubble/bubble_dialog_delegate.cc
+++ b/ui/views/bubble/bubble_dialog_delegate.cc
@@ -158,6 +158,14 @@ void BubbleDialogDelegateView::OnWidgetBoundsChanged(
SizeToContents();
}
+void BubbleDialogDelegateView::AddedToWidget() {
+ View* title_view = CreateTitleView();
+ if (title_view) {
+ GetBubbleFrameView()->SetTitleView(title_view);
+ PropagateUpdateTitleView(title_view);
+ }
+}
+
View* BubbleDialogDelegateView::GetAnchorView() const {
return anchor_view_tracker_->view();
}
@@ -241,6 +249,15 @@ const gfx::FontList& BubbleDialogDelegateView::GetTitleFontList() const {
return rb.GetFontList(ui::ResourceBundle::MediumFont);
}
+View* BubbleDialogDelegateView::CreateTitleView() {
+ return nullptr;
+}
+
+void BubbleDialogDelegateView::PropagateUpdateTitleView(View* title_view) {
+ if (title_view)
+ UpdateTitleView(title_view, GetWindowTitle(), ShouldShowWindowTitle());
+}
+
void BubbleDialogDelegateView::OnNativeThemeChanged(
const ui::NativeTheme* theme) {
UpdateColorsFromTheme(theme);

Powered by Google App Engine
This is Rietveld 408576698