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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/views/bubble/bubble_delegate.h" | 9 #include "ui/views/bubble/bubble_delegate.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 class ToolbarActionsBarBubbleDelegate; | 13 class ToolbarActionsBarBubbleDelegate; |
14 class ToolbarActionsBarBubbleViewsUnitTest; | 14 class ToolbarActionsBarBubbleViewsUnitTest; |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class Label; | 17 class Label; |
18 class LabelButton; | 18 class LabelButton; |
19 } | 19 } |
20 | 20 |
21 // TODO(devlin): It might be best for this to combine with | 21 // TODO(devlin): It might be best for this to combine with |
22 // ExtensionMessageBubbleView, similar to what we do on Mac. | 22 // ExtensionMessageBubbleView, similar to what we do on Mac. |
23 class ToolbarActionsBarBubbleViews : public views::BubbleDelegateView, | 23 class ToolbarActionsBarBubbleViews : public views::BubbleDelegateView, |
24 public views::ButtonListener { | 24 public views::ButtonListener { |
25 public: | 25 public: |
26 ToolbarActionsBarBubbleViews( | 26 ToolbarActionsBarBubbleViews( |
27 views::View* anchor_view, | 27 views::View* anchor_view, |
28 scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate); | 28 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate); |
29 ~ToolbarActionsBarBubbleViews() override; | 29 ~ToolbarActionsBarBubbleViews() override; |
30 | 30 |
31 void Show(); | 31 void Show(); |
32 | 32 |
33 const views::Label* heading_label() const { return heading_label_; } | 33 const views::Label* heading_label() const { return heading_label_; } |
34 const views::Label* content_label() const { return content_label_; } | 34 const views::Label* content_label() const { return content_label_; } |
35 const views::LabelButton* action_button() const { return action_button_; } | 35 const views::LabelButton* action_button() const { return action_button_; } |
36 const views::LabelButton* dismiss_button() const { return dismiss_button_; } | 36 const views::LabelButton* dismiss_button() const { return dismiss_button_; } |
37 | 37 |
38 private: | 38 private: |
39 // views::BubbleDelegateView: | 39 // views::BubbleDelegateView: |
40 void Init() override; | 40 void Init() override; |
41 void OnWidgetDestroying(views::Widget* widget) override; | 41 void OnWidgetDestroying(views::Widget* widget) override; |
42 | 42 |
43 // views::ButtonListener: | 43 // views::ButtonListener: |
44 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 44 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
45 | 45 |
46 scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate_; | 46 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_; |
47 | 47 |
48 views::Label* heading_label_; | 48 views::Label* heading_label_; |
49 views::Label* content_label_; | 49 views::Label* content_label_; |
50 | 50 |
51 views::LabelButton* dismiss_button_; | 51 views::LabelButton* dismiss_button_; |
52 views::LabelButton* action_button_; | 52 views::LabelButton* action_button_; |
53 | 53 |
54 // Whether or not the user acknowledged the bubble by clicking the "ok" | 54 // Whether or not the user acknowledged the bubble by clicking the "ok" |
55 // button. | 55 // button. |
56 bool acknowledged_; | 56 bool acknowledged_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); | 58 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews); |
59 }; | 59 }; |
60 | 60 |
61 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ | 61 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_H_ |
OLD | NEW |