Chromium Code Reviews| Index: chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h |
| diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h b/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h |
| index 1b75dbeac845eb46e9f9679e6d6e513d20f3bf86..9ed286fa97349297cc2657cf74c40d2d6bb03b78 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h |
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h |
| @@ -8,6 +8,7 @@ |
| #include <string> |
| #include "base/strings/string16.h" |
| +#include "ui/gfx/vector_icons_public.h" |
| // A delegate for a generic bubble that hangs off the toolbar actions bar. |
| class ToolbarActionsBarBubbleDelegate { |
| @@ -19,6 +20,24 @@ class ToolbarActionsBarBubbleDelegate { |
| CLOSE_DISMISS_DEACTIVATION, |
| }; |
| + // Content populating an optional view, containing an image icon and/or |
| + // (linked) text, in the bubble. |
| + struct ExtraViewInfo { |
| + ExtraViewInfo() |
| + : resource_id(gfx::VectorIconId::VECTOR_ICON_NONE), |
| + is_text_linked(false) {} |
| + |
| + // The resource id referencing the image icon. If has a value of -1, then no |
| + // image icon will be added. |
| + gfx::VectorIconId resource_id; |
|
Devlin
2016/11/01 00:21:21
nit: \n
catmullings
2016/11/01 02:46:53
Done.
|
| + // Text in the view. If this is an empty string, no text will be added. |
| + base::string16 text; |
|
Devlin
2016/11/01 00:21:21
nit: \n
catmullings
2016/11/01 02:46:53
Done.
|
| + // If the struct's text is nonempty and this value is true, then a link of |
| + // the text is added. If this value is false, the text is not treated as a |
| + // link. |
| + bool is_text_linked; |
| + }; |
| + |
| virtual ~ToolbarActionsBarBubbleDelegate() {} |
| // Returns true if the bubble should (still) be shown. Since bubbles are |
| @@ -64,6 +83,11 @@ class ToolbarActionsBarBubbleDelegate { |
| // Called when the bubble is closed with the type of action the user took. |
| virtual void OnBubbleClosed(CloseAction action) = 0; |
| + |
| + // Returns the ExtraViewInfo struct associated with the bubble delegate. If |
| + // this returns a nullptr, no extra view (image icon and/or (linked) text) is |
| + // added to the bubble. |
| + virtual std::unique_ptr<ExtraViewInfo> GetExtraViewInfo() = 0; |
| }; |
| #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |