Chromium Code Reviews| 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 #include "chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h" | 5 #include "chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 class TestToolbarActionsBarBubbleDelegate::DelegateImpl | 10 class TestToolbarActionsBarBubbleDelegate::DelegateImpl |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 base::string16 GetHeadingText() override { return parent_->heading_; } | 22 base::string16 GetHeadingText() override { return parent_->heading_; } |
| 23 base::string16 GetBodyText(bool anchored_to_action) override { | 23 base::string16 GetBodyText(bool anchored_to_action) override { |
| 24 return parent_->body_; | 24 return parent_->body_; |
| 25 } | 25 } |
| 26 base::string16 GetItemListText() override { return parent_->item_list_; } | 26 base::string16 GetItemListText() override { return parent_->item_list_; } |
| 27 base::string16 GetActionButtonText() override { return parent_->action_; } | 27 base::string16 GetActionButtonText() override { return parent_->action_; } |
| 28 base::string16 GetDismissButtonText() override { return parent_->dismiss_; } | 28 base::string16 GetDismissButtonText() override { return parent_->dismiss_; } |
| 29 base::string16 GetLearnMoreButtonText() override { | 29 base::string16 GetLearnMoreButtonText() override { |
| 30 return parent_->learn_more_; | 30 return parent_->learn_more_; |
| 31 } | 31 } |
| 32 std::unique_ptr<ToolbarActionsBarBubbleDelegate::ExtraViewInfo> | |
| 33 GetExtraViewInfo() override { | |
| 34 std::unique_ptr<ToolbarActionsBarBubbleDelegate::ExtraViewInfo> | |
| 35 extra_view_info(new ExtraViewInfo(parent_->extra_view_info_)); | |
| 36 return extra_view_info; | |
|
Devlin
2016/09/26 20:13:09
return base::MakeUnique<ExtraViewInfo>(...)
catmullings
2016/10/06 18:24:19
Done.
| |
| 37 } | |
| 32 std::string GetAnchorActionId() override { return std::string(); } | 38 std::string GetAnchorActionId() override { return std::string(); } |
| 33 void OnBubbleShown() override { | 39 void OnBubbleShown() override { |
| 34 CHECK(!parent_->shown_); | 40 CHECK(!parent_->shown_); |
| 35 parent_->shown_ = true; | 41 parent_->shown_ = true; |
| 36 } | 42 } |
| 37 void OnBubbleClosed(CloseAction action) override { | 43 void OnBubbleClosed(CloseAction action) override { |
| 38 CHECK(!parent_->close_action_); | 44 CHECK(!parent_->close_action_); |
| 39 parent_->close_action_.reset(new CloseAction(action)); | 45 parent_->close_action_.reset(new CloseAction(action)); |
| 40 } | 46 } |
| 41 | 47 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 60 // which has a weak ptr to this object. Make sure that this class always | 66 // which has a weak ptr to this object. Make sure that this class always |
| 61 // outlives the bubble. | 67 // outlives the bubble. |
| 62 CHECK(close_action_); | 68 CHECK(close_action_); |
| 63 } | 69 } |
| 64 | 70 |
| 65 std::unique_ptr<ToolbarActionsBarBubbleDelegate> | 71 std::unique_ptr<ToolbarActionsBarBubbleDelegate> |
| 66 TestToolbarActionsBarBubbleDelegate::GetDelegate() { | 72 TestToolbarActionsBarBubbleDelegate::GetDelegate() { |
| 67 return std::unique_ptr<ToolbarActionsBarBubbleDelegate>( | 73 return std::unique_ptr<ToolbarActionsBarBubbleDelegate>( |
| 68 new DelegateImpl(this)); | 74 new DelegateImpl(this)); |
| 69 } | 75 } |
| OLD | NEW |