| 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_delegate.h" | 11 #include "ui/views/bubble/bubble_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 | 14 |
| 14 class Profile; | 15 class Profile; |
| 15 class ToolbarActionsBarBubbleDelegate; | 16 class ToolbarActionsBarBubbleDelegate; |
| 16 class ToolbarActionsBarBubbleViewsUnitTest; | 17 class ToolbarActionsBarBubbleViewsUnitTest; |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 class Label; | 20 class Label; |
| 20 class LabelButton; | 21 class LabelButton; |
| 22 class Link; |
| 21 } | 23 } |
| 22 | 24 |
| 23 // TODO(devlin): It might be best for this to combine with | 25 // TODO(devlin): It might be best for this to combine with |
| 24 // ExtensionMessageBubbleView, similar to what we do on Mac. | 26 // ExtensionMessageBubbleView, similar to what we do on Mac. |
| 25 class ToolbarActionsBarBubbleViews : public views::BubbleDelegateView, | 27 class ToolbarActionsBarBubbleViews : public views::BubbleDelegateView, |
| 26 public views::ButtonListener { | 28 public views::ButtonListener, |
| 29 public views::LinkListener { |
| 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* heading_label() const { return heading_label_; } | 38 const views::Label* heading_label() const { return heading_label_; } |
| 36 const views::Label* content_label() const { return content_label_; } | 39 const views::Label* content_label() const { return content_label_; } |
| 40 const views::Label* item_list() const { return item_list_; } |
| 37 const views::LabelButton* action_button() const { return action_button_; } | 41 const views::LabelButton* action_button() const { return action_button_; } |
| 38 const views::LabelButton* dismiss_button() const { return dismiss_button_; } | 42 const views::LabelButton* dismiss_button() const { return dismiss_button_; } |
| 43 const views::Link* learn_more_button() const { return learn_more_button_; } |
| 39 | 44 |
| 40 private: | 45 private: |
| 41 // views::BubbleDelegateView: | 46 // views::BubbleDelegateView: |
| 42 void Init() override; | 47 void Init() override; |
| 43 void OnWidgetDestroying(views::Widget* widget) override; | 48 void OnWidgetDestroying(views::Widget* widget) override; |
| 44 | 49 |
| 45 // views::ButtonListener: | 50 // views::ButtonListener: |
| 46 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 51 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 47 | 52 |
| 53 // views::LinkListener: |
| 54 void LinkClicked(views::Link* source, int event_flags) override; |
| 55 |
| 48 views::View* anchor_view_; | 56 views::View* anchor_view_; |
| 49 | 57 |
| 50 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_; | 58 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_; |
| 51 | 59 |
| 52 views::Label* heading_label_; | 60 views::Label* heading_label_; |
| 53 views::Label* content_label_; | 61 views::Label* content_label_; |
| 62 views::Label* item_list_; |
| 54 | 63 |
| 64 views::Link* learn_more_button_; |
| 55 views::LabelButton* dismiss_button_; | 65 views::LabelButton* dismiss_button_; |
| 56 views::LabelButton* action_button_; | 66 views::LabelButton* action_button_; |
| 57 | 67 |
| 58 // Whether or not the user acknowledged the bubble by clicking the "ok" | 68 // Whether or not the user acknowledged the bubble by clicking the "ok" |
| 59 // button. | 69 // button. |
| 60 bool acknowledged_; | 70 bool acknowledged_; |
| 61 | 71 |
| 62 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); | 72 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); |
| 63 }; | 73 }; |
| 64 | 74 |
| 65 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ | 75 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ |
| OLD | NEW |