| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ | 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_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Returns a delegate to pass to the bubble. Since the bubble typically owns | 22 // Returns a delegate to pass to the bubble. Since the bubble typically owns |
| 23 // the delegate, it means we can't have this object be the delegate, because | 23 // the delegate, it means we can't have this object be the delegate, because |
| 24 // it would be deleted once the bubble closes. | 24 // it would be deleted once the bubble closes. |
| 25 std::unique_ptr<ToolbarActionsBarBubbleDelegate> GetDelegate(); | 25 std::unique_ptr<ToolbarActionsBarBubbleDelegate> GetDelegate(); |
| 26 | 26 |
| 27 void set_dismiss_button_text(const base::string16& dismiss) { | 27 void set_dismiss_button_text(const base::string16& dismiss) { |
| 28 dismiss_ = dismiss; | 28 dismiss_ = dismiss; |
| 29 } | 29 } |
| 30 void set_learn_more_button_text(const base::string16& learn_more) { | 30 void set_learn_more_button_text(const base::string16& learn_more) { |
| 31 learn_more_ = learn_more; | 31 learn_more_ = learn_more; |
| 32 |
| 33 ToolbarActionsBarBubbleDelegate::ExtraViewInfo extra_view_info_linked_text; |
| 34 extra_view_info_linked_text.text = learn_more; |
| 35 extra_view_info_linked_text.is_text_linked = true; |
| 36 set_extra_view_info(extra_view_info_linked_text); |
| 32 } | 37 } |
| 33 void set_item_list_text(const base::string16& item_list) { | 38 void set_item_list_text(const base::string16& item_list) { |
| 34 item_list_ = item_list; | 39 item_list_ = item_list; |
| 35 } | 40 } |
| 36 void set_close_on_deactivate(bool close_on_deactivate) { | 41 void set_close_on_deactivate(bool close_on_deactivate) { |
| 37 close_on_deactivate_ = close_on_deactivate; | 42 close_on_deactivate_ = close_on_deactivate; |
| 38 } | 43 } |
| 44 void set_extra_view_info( |
| 45 const ToolbarActionsBarBubbleDelegate::ExtraViewInfo& extra_view_info) { |
| 46 extra_view_info_ = extra_view_info; |
| 47 } |
| 39 | 48 |
| 40 const ToolbarActionsBarBubbleDelegate::CloseAction* close_action() const { | 49 const ToolbarActionsBarBubbleDelegate::CloseAction* close_action() const { |
| 41 return close_action_.get(); | 50 return close_action_.get(); |
| 42 } | 51 } |
| 43 bool shown() const { return shown_; } | 52 bool shown() const { return shown_; } |
| 44 | 53 |
| 45 private: | 54 private: |
| 46 class DelegateImpl; | 55 class DelegateImpl; |
| 47 | 56 |
| 48 // Whether or not the bubble has been shown. | 57 // Whether or not the bubble has been shown. |
| 49 bool shown_; | 58 bool shown_; |
| 50 | 59 |
| 51 // The action that was taken to close the bubble. | 60 // The action that was taken to close the bubble. |
| 52 std::unique_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> close_action_; | 61 std::unique_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> close_action_; |
| 53 | 62 |
| 54 // Strings for the bubble. | 63 // Strings for the bubble. |
| 55 base::string16 heading_; | 64 base::string16 heading_; |
| 56 base::string16 body_; | 65 base::string16 body_; |
| 57 base::string16 action_; | 66 base::string16 action_; |
| 58 base::string16 dismiss_; | 67 base::string16 dismiss_; |
| 59 base::string16 learn_more_; | 68 base::string16 learn_more_; |
| 60 base::string16 item_list_; | 69 base::string16 item_list_; |
| 61 | 70 |
| 62 // Whether to close the bubble on deactivation. | 71 // Whether to close the bubble on deactivation. |
| 63 bool close_on_deactivate_; | 72 bool close_on_deactivate_; |
| 64 | 73 |
| 74 // Extra view information inputted into the bubble. |
| 75 ToolbarActionsBarBubbleDelegate::ExtraViewInfo extra_view_info_; |
| 76 |
| 65 DISALLOW_COPY_AND_ASSIGN(TestToolbarActionsBarBubbleDelegate); | 77 DISALLOW_COPY_AND_ASSIGN(TestToolbarActionsBarBubbleDelegate); |
| 66 }; | 78 }; |
| 67 | 79 |
| 68 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ | 80 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_ACTIONS_BAR_BUBBLE_DELEGATE_H_ |
| OLD | NEW |