Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc |
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc |
| index 6ab2dacebf97ebdb3cae5f686afb1a08fbb9aa18..f22ba58b8cb2dd650fbf8d4d4904c7b2d043f2de 100644 |
| --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc |
| +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc |
| @@ -9,6 +9,7 @@ |
| #include "chrome/grit/locale_settings.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/views/controls/button/label_button.h" |
| +#include "ui/views/controls/image_view.h" |
| #include "ui/views/controls/label.h" |
| #include "ui/views/controls/link.h" |
| #include "ui/views/layout/box_layout.h" |
| @@ -37,13 +38,33 @@ void ToolbarActionsBarBubbleViews::Show() { |
| } |
| views::View* ToolbarActionsBarBubbleViews::CreateExtraView() { |
| - base::string16 text = delegate_->GetLearnMoreButtonText(); |
| - if (text.empty()) |
| + std::unique_ptr<ToolbarActionsBarBubbleDelegate::ExtraViewInfo> |
| + extra_view_info = delegate_->GetExtraViewInfo(); |
| + |
| + base::string16 text = extra_view_info->text; |
| + |
| + if (text.empty()) { |
| return nullptr; |
|
Devlin
2016/08/02 20:34:06
What if we wanted to *just* show an icon, with no
catmullings
2016/08/13 00:35:52
Done.
|
| + } |
| + |
| + if (extra_view_info->is_clickable) { |
| + views::Link* button = new views::Link(text); |
| + button->set_listener(this); |
| + |
| + // TODO: Should I expect the text to always be the learn_more_button_? |
| + // If not, should I still instantiate the learn_more_button_? |
|
Devlin
2016/08/02 20:34:06
right now, it would be, and keeping it like this i
catmullings
2016/08/13 00:35:52
Done.
|
| + learn_more_button_ = new views::Link(text); |
| + learn_more_button_->set_listener(this); |
| + |
| + return button; |
|
Devlin
2016/08/02 20:34:06
What about the case of a link + an icon?
catmullings
2016/08/13 00:35:52
Done.
|
| + } |
| - learn_more_button_ = new views::Link(text); |
| - learn_more_button_->set_listener(this); |
| - return learn_more_button_; |
| + views::View* parent = new views::View(); |
| + views::ImageView* icon = extra_view_info->icon; |
| + parent->AddChildView(icon); |
| + views::Label* label = new views::Label(text); |
| + parent->AddChildView(label); |
| + return parent; |
| } |
| base::string16 ToolbarActionsBarBubbleViews::GetWindowTitle() const { |