Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/views/bubble/bubble_dialog_delegate.h" | 11 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/controls/link_listener.h" | 13 #include "ui/views/controls/link_listener.h" |
| 14 | 14 |
| 15 class Profile; | 15 class Profile; |
| 16 class ToolbarActionsBarBubbleDelegate; | 16 class ToolbarActionsBarBubbleDelegate; |
| 17 class ToolbarActionsBarBubbleViewsUnitTest; | 17 class ToolbarActionsBarBubbleViewsUnitTest; |
| 18 class ToolbarActionsBarBubbleViewsTest; | |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 class Label; | 21 class Label; |
| 21 class LabelButton; | 22 class LabelButton; |
| 22 class Link; | 23 class Link; |
| 23 } | 24 } |
| 24 | 25 |
| 25 class ToolbarActionsBarBubbleViews : public views::BubbleDialogDelegateView, | 26 class ToolbarActionsBarBubbleViews : public views::BubbleDialogDelegateView, |
| 26 public views::LinkListener { | 27 public views::LinkListener { |
| 28 friend class ToolbarActionsBarBubbleViewsTest; | |
|
Devlin
2016/09/26 20:13:09
put friend classes in the private: section of the
catmullings
2016/10/06 18:24:19
Done.
| |
| 29 | |
| 27 public: | 30 public: |
| 28 ToolbarActionsBarBubbleViews( | 31 ToolbarActionsBarBubbleViews( |
| 29 views::View* anchor_view, | 32 views::View* anchor_view, |
| 30 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate); | 33 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate); |
| 31 ~ToolbarActionsBarBubbleViews() override; | 34 ~ToolbarActionsBarBubbleViews() override; |
| 32 | 35 |
| 33 void Show(); | 36 void Show(); |
| 34 | 37 |
| 35 const views::Label* item_list() const { return item_list_; } | 38 const views::Label* item_list() const { return item_list_; } |
| 36 const views::Link* learn_more_button() const { return learn_more_button_; } | 39 const views::Link* learn_more_button() const { return link_; } |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 // views::BubbleDialogDelegateView: | 42 // views::BubbleDialogDelegateView: |
| 40 base::string16 GetWindowTitle() const override; | 43 base::string16 GetWindowTitle() const override; |
| 41 views::View* CreateExtraView() override; | 44 views::View* CreateExtraView() override; |
| 42 bool Cancel() override; | 45 bool Cancel() override; |
| 43 bool Accept() override; | 46 bool Accept() override; |
| 44 bool Close() override; | 47 bool Close() override; |
| 45 int GetDialogButtons() const override; | 48 int GetDialogButtons() const override; |
| 46 int GetDefaultDialogButton() const override; | 49 int GetDefaultDialogButton() const override; |
| 47 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 50 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 48 void Init() override; | 51 void Init() override; |
| 49 | 52 |
| 50 // views::LinkListener: | 53 // views::LinkListener: |
| 51 void LinkClicked(views::Link* source, int event_flags) override; | 54 void LinkClicked(views::Link* source, int event_flags) override; |
| 52 | 55 |
| 53 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_; | 56 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_; |
| 54 views::Label* item_list_; | 57 views::Label* item_list_; |
| 55 views::Link* learn_more_button_; | 58 views::Link* link_; |
| 59 views::Label* label_; | |
|
Devlin
2016/09/26 20:13:10
Is this used?
catmullings
2016/10/06 18:24:19
Nice catch.
Done.
| |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); | 61 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ | 64 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ |
| OLD | NEW |