Chromium Code Reviews| Index: chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h |
| diff --git a/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h b/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..09ae3c5e941169ab1f2ac5334cce7a6685a13870 |
| --- /dev/null |
| +++ b/chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |
| +#define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
| + |
| +// A test delegate for a bubble to hang off the toolbar actions bar. |
| +class TestToolbarActionsBarBubbleDelegate { |
| + public: |
| + TestToolbarActionsBarBubbleDelegate( |
| + const base::string16& heading, |
| + const base::string16& body, |
| + const base::string16& action); |
| + ~TestToolbarActionsBarBubbleDelegate(); |
| + |
| + // Returns a delegate to pass to the bubble. Since the bubble typically owns |
| + // the delegate, it means we can't have this object be the delegate, because |
| + // it would be deleted once the bubble closes. |
| + scoped_ptr<ToolbarActionsBarBubbleDelegate> GetDelegate(); |
| + |
| + void set_dismiss_button(const base::string16& dismiss) { dismiss_ = dismiss; } |
| + 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.
|
| + learn_more_ = learn_more; |
| + } |
| + |
| + const ToolbarActionsBarBubbleDelegate::CloseAction* close_action() const { |
| + return close_action_.get(); |
| + } |
| + bool shown() const { return shown_; } |
| + |
| + private: |
| + class DelegateImpl; |
| + |
| + // Whether or not the bubble has been shown. |
| + bool shown_; |
| + |
| + // The action that was taken to close the bubble. |
| + scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> close_action_; |
| + |
| + // Strings for the bubble. |
| + base::string16 heading_; |
| + base::string16 body_; |
| + base::string16 action_; |
| + base::string16 dismiss_; |
| + base::string16 learn_more_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TestToolbarActionsBarBubbleDelegate); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |