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

Unified Diff: ui/views/bubble/bubble_frame_view.h

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_frame_view.h
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h
index 4f4d94647a9d20d963fecd7794bb06b640751441..908fbba15d32f06f85f2dd3cd771440a3617e73a 100644
--- a/ui/views/bubble/bubble_frame_view.h
+++ b/ui/views/bubble/bubble_frame_view.h
@@ -8,17 +8,14 @@
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/controls/button/button.h"
+#include "ui/views/controls/label.h"
#include "ui/views/window/non_client_view.h"
-namespace gfx {
-class FontList;
-}
-
namespace views {
-class Label;
class BubbleBorder;
class ImageView;
@@ -52,6 +49,11 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
// Caller must arrange to update the layout to have the call take effect.
void SetTitleFontList(const gfx::FontList& font_list);
+ // Sets a custom view to be the dialog title instead of the |default_title_|
+ // label. The title view is owned by this BubbleFrameView. If there is an
+ // existing title view it will be deleted.
+ void SetTitleView(View* title_view);
+
// View:
const char* GetClassName() const override;
gfx::Insets GetInsets() const override;
@@ -126,9 +128,14 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
// The optional title icon, title, and (x) close button.
views::ImageView* title_icon_;
- Label* title_;
+ Label* default_title_;
+ View* delegate_title_;
Button* close_;
+ View* title() const {
sky 2017/06/09 23:49:16 Move above functions.
Bret 2017/06/15 22:20:35 Done.
+ return delegate_title_ ? delegate_title_ : default_title_;
+ }
+
// A view to contain the footnote view, if it exists.
View* footnote_container_;

Powered by Google App Engine
This is Rietveld 408576698