Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 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_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" | |
| 11 | |
| 12 // A test delegate for a bubble to hang off the toolbar actions bar. | |
| 13 class TestToolbarActionsBarBubbleDelegate { | |
| 14 public: | |
| 15 TestToolbarActionsBarBubbleDelegate( | |
| 16 const base::string16& heading, | |
| 17 const base::string16& body, | |
| 18 const base::string16& action); | |
| 19 ~TestToolbarActionsBarBubbleDelegate(); | |
| 20 | |
| 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(); | |
| 25 | |
| 26 void set_dismiss_button(const base::string16& dismiss) { dismiss_ = dismiss; } | |
| 27 void set_learn_more_button(const base::string16& learn_more) { | |
|
Finnur
2015/04/16 09:52:09
Nit: It feels like these functions need a _text or
Devlin
2015/04/16 15:59:51
Done.
| |
| 28 learn_more_ = learn_more; | |
| 29 } | |
| 30 | |
| 31 const ToolbarActionsBarBubbleDelegate::CloseAction* close_action() const { | |
| 32 return close_action_.get(); | |
| 33 } | |
| 34 bool shown() const { return shown_; } | |
| 35 | |
| 36 private: | |
| 37 class DelegateImpl; | |
| 38 | |
| 39 // Whether or not the bubble has been shown. | |
| 40 bool shown_; | |
| 41 | |
| 42 // The action that was taken to close the bubble. | |
| 43 scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> close_action_; | |
| 44 | |
| 45 // Strings for the bubble. | |
| 46 base::string16 heading_; | |
| 47 base::string16 body_; | |
| 48 base::string16 action_; | |
| 49 base::string16 dismiss_; | |
| 50 base::string16 learn_more_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(TestToolbarActionsBarBubbleDelegate); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ | |
| OLD | NEW |