| 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..0a643f2a2ed54c5ec041215e3b3aee41f326ae8a 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;
|
|
|
| @@ -33,6 +30,9 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
|
| const gfx::Insets& content_margins);
|
| ~BubbleFrameView() override;
|
|
|
| + static std::unique_ptr<Label> CreateDefaultTitleLabel(
|
| + const base::string16& title_text);
|
| +
|
| // Creates a close button used in the corner of the dialog.
|
| static Button* CreateCloseButton(ButtonListener* listener);
|
|
|
| @@ -48,9 +48,10 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
|
| void UpdateWindowTitle() override;
|
| void SizeConstraintsChanged() override;
|
|
|
| - // Set the FontList to be used for the title of the bubble.
|
| - // 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;
|
| @@ -101,6 +102,14 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
|
| FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons);
|
| FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateTest, CloseMethods);
|
|
|
| + const View* title() const {
|
| + return custom_title_ ? custom_title_ : default_title_;
|
| + }
|
| + View* title() {
|
| + return const_cast<View*>(
|
| + static_cast<const BubbleFrameView*>(this)->title());
|
| + }
|
| +
|
| // Mirrors the bubble's arrow location on the |vertical| or horizontal axis,
|
| // if the generated window bounds don't fit in the monitor bounds.
|
| void MirrorArrowIfOffScreen(bool vertical,
|
| @@ -124,9 +133,16 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
|
| // Margins between the content and the inside of the border, in pixels.
|
| gfx::Insets content_margins_;
|
|
|
| - // The optional title icon, title, and (x) close button.
|
| + // The optional title icon.
|
| views::ImageView* title_icon_;
|
| - Label* title_;
|
| +
|
| + // One of these fields is used as the dialog title. If SetTitleView is called
|
| + // the custom title view is stored in |custom_title_| and this class assumes
|
| + // ownership. Otherwise |default_title_| is used.
|
| + Label* default_title_;
|
| + View* custom_title_;
|
| +
|
| + // The optional close button (the X).
|
| Button* close_;
|
|
|
| // A view to contain the footnote view, if it exists.
|
|
|