| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
| 11 #include "ui/views/controls/button/button.h" | |
| 12 #include "ui/views/controls/button/image_button.h" | 11 #include "ui/views/controls/button/image_button.h" |
| 13 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 14 | 13 |
| 15 namespace views { | 14 namespace views { |
| 16 class Label; | 15 class Label; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace message_center { | 18 namespace message_center { |
| 20 | 19 |
| 21 class MessageCenter; | 20 class MessageCenter; |
| 22 class MessageCenterView; | 21 class MessageCenterView; |
| 23 class NotificationCenterButton; | 22 class NotificationCenterButton; |
| 24 class NotifierSettingsProvider; | 23 class NotifierSettingsProvider; |
| 25 | 24 |
| 26 // MessageCenterButtonBar is the class that shows the content outside the main | 25 // MessageCenterButtonBar is the class that shows the content outside the main |
| 27 // notification area - the label (or NotifierGroup switcher) and the buttons. | 26 // notification area - the label (or NotifierGroup switcher) and the buttons. |
| 28 class MessageCenterButtonBar : public views::View, | 27 class MessageCenterButtonBar : public views::View, |
| 29 public views::ButtonListener { | 28 public views::ImageButtonDelegate { |
| 30 public: | 29 public: |
| 31 MessageCenterButtonBar(MessageCenterView* message_center_view, | 30 MessageCenterButtonBar(MessageCenterView* message_center_view, |
| 32 MessageCenter* message_center, | 31 MessageCenter* message_center, |
| 33 NotifierSettingsProvider* notifier_settings_provider, | 32 NotifierSettingsProvider* notifier_settings_provider, |
| 34 bool settings_initially_visible, | 33 bool settings_initially_visible, |
| 35 const base::string16& title); | 34 const base::string16& title); |
| 36 ~MessageCenterButtonBar() override; | 35 ~MessageCenterButtonBar() override; |
| 37 | 36 |
| 38 // Enables or disables all of the buttons in the center. This is used to | 37 // Enables or disables all of the buttons in the center. This is used to |
| 39 // prevent user clicks during the close-all animation. | 38 // prevent user clicks during the close-all animation. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 52 // Update the label of the title. | 51 // Update the label of the title. |
| 53 void SetTitle(const base::string16& title); | 52 void SetTitle(const base::string16& title); |
| 54 | 53 |
| 55 void SetButtonsVisible(bool visible); | 54 void SetButtonsVisible(bool visible); |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 // Updates the layout manager which can have differing configuration | 57 // Updates the layout manager which can have differing configuration |
| 59 // depending on the visibility of different parts of the button bar. | 58 // depending on the visibility of different parts of the button bar. |
| 60 void ViewVisibilityChanged(); | 59 void ViewVisibilityChanged(); |
| 61 | 60 |
| 62 // Overridden from views::View: | 61 // views::View: |
| 63 void ChildVisibilityChanged(views::View* child) override; | 62 void ChildVisibilityChanged(views::View* child) override; |
| 64 | 63 |
| 65 // Overridden from views::ButtonListener: | 64 // views::ImageButtonDelegate: |
| 66 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 65 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 67 | 66 |
| 68 MessageCenterView* message_center_view() const { | 67 MessageCenterView* message_center_view() const { |
| 69 return message_center_view_; | 68 return message_center_view_; |
| 70 } | 69 } |
| 71 MessageCenter* message_center() const { return message_center_; } | 70 MessageCenter* message_center() const { return message_center_; } |
| 72 | 71 |
| 73 MessageCenterView* message_center_view_; // Weak reference. | 72 MessageCenterView* message_center_view_; // Weak reference. |
| 74 MessageCenter* message_center_; // Weak reference. | 73 MessageCenter* message_center_; // Weak reference. |
| 75 | 74 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 89 NotificationCenterButton* close_all_button_; | 88 NotificationCenterButton* close_all_button_; |
| 90 NotificationCenterButton* settings_button_; | 89 NotificationCenterButton* settings_button_; |
| 91 NotificationCenterButton* quiet_mode_button_; | 90 NotificationCenterButton* quiet_mode_button_; |
| 92 | 91 |
| 93 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar); | 92 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar); |
| 94 }; | 93 }; |
| 95 | 94 |
| 96 } // namespace message_center | 95 } // namespace message_center |
| 97 | 96 |
| 98 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ | 97 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |
| OLD | NEW |