Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |
| 6 | #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |
| 7 | |
| 8 | #include "ui/views/controls/button/button.h" |
| 9 | #include "ui/views/view.h" |
| 10 | |
| 11 | namespace views { |
| 12 | class Label; |
| 13 | } |
| 14 | |
| 15 | namespace message_center { |
| 16 | |
| 17 | class ButtonBarSettingsLabel; |
| 18 | class MessageCenter; |
| 19 | class MessageCenterTray; |
| 20 | class MessageCenterView; |
| 21 | class NotificationCenterButton; |
| 22 | class NotifierSettingsProvider; |
| 23 | |
| 24 | // MessageCenterButtonBar is the class that shows the content outside the main |
| 25 | // notification area - the label (or NotifierGroup switcher) and the buttons. |
| 26 | class MessageCenterButtonBar : public views::View, |
| 27 | public views::ButtonListener { |
| 28 | public: |
| 29 | MessageCenterButtonBar(MessageCenterView* message_center_view, |
| 30 | MessageCenter* message_center, |
| 31 | NotifierSettingsProvider* notifier_settings_provider, |
| 32 | bool settings_initially_visible); |
| 33 | virtual ~MessageCenterButtonBar(); |
| 34 | |
| 35 | // Enables or disables all of the buttons in the center. This is used to |
| 36 | // prevent user clicks during the close-all animation. |
| 37 | virtual void SetAllButtonsEnabled(bool enabled); |
| 38 | |
| 39 | // Sometimes we shouldn't see the close-all button. |
| 40 | void SetCloseAllButtonVisible(bool visible); |
| 41 | |
| 42 | private: |
| 43 | // Overridden from views::View: |
| 44 | virtual void ChildVisibilityChanged(views::View* child) OVERRIDE; |
| 45 | |
| 46 | // Overridden from views::ButtonListener: |
| 47 | virtual void ButtonPressed(views::Button* sender, |
| 48 | const ui::Event& event) OVERRIDE; |
| 49 | |
| 50 | MessageCenterView* message_center_view() const { |
| 51 | return message_center_view_; |
| 52 | } |
| 53 | MessageCenter* message_center() const { return message_center_; } |
| 54 | |
| 55 | MessageCenterView* message_center_view_; // Weak reference. |
| 56 | MessageCenter* message_center_; // Weak reference. |
| 57 | |
| 58 | // Sub-views of the button bar. |
| 59 | views::Button* close_all_button_; |
| 60 | NotificationCenterButton* settings_button_; |
| 61 | NotificationCenterButton* quiet_mode_button_; |
| 62 | |
| 63 | DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar); |
| 64 | }; |
| 65 | |
| 66 | } // namespace message_center |
| 67 | |
| 68 | #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_ |