1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"
12 // A test delegate for a bubble to hang off the toolbar actions bar.
13 class TestToolbarActionsBarBubbleDelegate
{
15 TestToolbarActionsBarBubbleDelegate(
16 const base::string16
& heading
,
17 const base::string16
& body
,
18 const base::string16
& action
);
19 ~TestToolbarActionsBarBubbleDelegate();
21 // Returns a delegate to pass to the bubble. Since the bubble typically owns
22 // the delegate, it means we can't have this object be the delegate, because
23 // it would be deleted once the bubble closes.
24 scoped_ptr
<ToolbarActionsBarBubbleDelegate
> GetDelegate();
26 void set_dismiss_button_text(const base::string16
& dismiss
) {
29 void set_learn_more_button_text(const base::string16
& learn_more
) {
30 learn_more_
= learn_more
;
32 void set_item_list_text(const base::string16
& item_list
) {
33 item_list_
= item_list
;
36 const ToolbarActionsBarBubbleDelegate::CloseAction
* close_action() const {
37 return close_action_
.get();
39 bool shown() const { return shown_
; }
44 // Whether or not the bubble has been shown.
47 // The action that was taken to close the bubble.
48 scoped_ptr
<ToolbarActionsBarBubbleDelegate::CloseAction
> close_action_
;
50 // Strings for the bubble.
51 base::string16 heading_
;
53 base::string16 action_
;
54 base::string16 dismiss_
;
55 base::string16 learn_more_
;
56 base::string16 item_list_
;
58 DISALLOW_COPY_AND_ASSIGN(TestToolbarActionsBarBubbleDelegate
);
61 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_