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