| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
| 7 | 7 |
| 8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
| 9 | 9 |
| 10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
| 11 #include "ui/message_center/message_center_export.h" | 11 #include "ui/message_center/message_center_export.h" |
| 12 #include "ui/message_center/message_center_observer.h" | 12 #include "ui/message_center/message_center_observer.h" |
| 13 #include "ui/message_center/notification_list.h" | 13 #include "ui/message_center/notification_list.h" |
| 14 #include "ui/views/controls/button/button.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 class MultiAnimation; | 17 class MultiAnimation; |
| 17 } // namespace ui | 18 } // namespace ui |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 class Button; | 21 class Button; |
| 21 } // namespace views | 22 } // namespace views |
| 22 | 23 |
| 23 namespace message_center { | 24 namespace message_center { |
| 24 | 25 |
| 25 class MessageCenter; | 26 class MessageCenter; |
| 26 class MessageCenterBubble; | 27 class MessageCenterBubble; |
| 28 class NotificationCenterButton; |
| 27 class MessageCenterTray; | 29 class MessageCenterTray; |
| 28 class MessageCenterView; | 30 class MessageCenterView; |
| 29 class MessageView; | 31 class MessageView; |
| 30 class MessageListView; | 32 class MessageListView; |
| 31 class NotifierSettingsView; | 33 class NotifierSettingsView; |
| 32 | 34 |
| 33 // MessageCenterButtonBar ////////////////////////////////////////////////////// | 35 // MessageCenterButtonBar ////////////////////////////////////////////////////// |
| 34 | 36 |
| 35 // If you know how to better hide this implementation class please do so, and | 37 // If you know how to better hide this implementation class please do so, and |
| 36 // otherwise please refrain from using it :-). | 38 // otherwise please refrain from using it :-). |
| 37 class MessageCenterButtonBar : public views::View { | 39 class MessageCenterButtonBar : public views::View, |
| 40 public views::ButtonListener { |
| 38 public: | 41 public: |
| 39 MessageCenterButtonBar(MessageCenterView* message_center_view, | 42 MessageCenterButtonBar(MessageCenterView* message_center_view, |
| 40 MessageCenter* message_center); | 43 MessageCenter* message_center); |
| 41 virtual ~MessageCenterButtonBar(); | 44 virtual ~MessageCenterButtonBar(); |
| 42 | 45 |
| 43 virtual void SetAllButtonsEnabled(bool enabled); | 46 virtual void SetAllButtonsEnabled(bool enabled); |
| 44 | |
| 45 void SetCloseAllVisible(bool visible); | 47 void SetCloseAllVisible(bool visible); |
| 46 | 48 |
| 47 protected: | 49 private: |
| 50 // Overridden from views::View: |
| 51 virtual void ChildVisibilityChanged(views::View* child) OVERRIDE; |
| 52 |
| 53 // Overridden from views::ButtonListener: |
| 54 virtual void ButtonPressed(views::Button* sender, const ui::Event& event) |
| 55 OVERRIDE; |
| 56 |
| 48 MessageCenterView* message_center_view() const { | 57 MessageCenterView* message_center_view() const { |
| 49 return message_center_view_; | 58 return message_center_view_; |
| 50 } | 59 } |
| 51 MessageCenter* message_center() const { return message_center_; } | 60 MessageCenter* message_center() const { return message_center_; } |
| 52 MessageCenterTray* tray() const { return tray_; } | 61 MessageCenterTray* tray() const { return tray_; } |
| 53 views::Button* close_all_button() const { return close_all_button_; } | 62 views::Button* close_all_button() const { return close_all_button_; } |
| 54 void set_close_all_button(views::Button* button) { | 63 void set_close_all_button(views::Button* button) { |
| 55 close_all_button_ = button; | 64 close_all_button_ = button; |
| 56 } | 65 } |
| 57 | 66 |
| 58 private: | |
| 59 MessageCenterView* message_center_view_; // Weak reference. | 67 MessageCenterView* message_center_view_; // Weak reference. |
| 60 MessageCenter* message_center_; // Weak reference. | 68 MessageCenter* message_center_; // Weak reference. |
| 61 MessageCenterTray* tray_; // Weak reference. | 69 MessageCenterTray* tray_; // Weak reference. |
| 62 views::Button* close_all_button_; | 70 views::Button* close_all_button_; |
| 71 NotificationCenterButton* settings_button_; |
| 72 NotificationCenterButton* quiet_mode_button_; |
| 63 | 73 |
| 64 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar); | 74 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar); |
| 65 }; | 75 }; |
| 66 | 76 |
| 67 // MessageCenterView /////////////////////////////////////////////////////////// | 77 // MessageCenterView /////////////////////////////////////////////////////////// |
| 68 | 78 |
| 69 class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View, | 79 class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View, |
| 70 public MessageCenterObserver, | 80 public MessageCenterObserver, |
| 71 public ui::AnimationDelegate { | 81 public ui::AnimationDelegate { |
| 72 public: | 82 public: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 int source_height_; | 138 int source_height_; |
| 129 int target_height_; | 139 int target_height_; |
| 130 scoped_ptr<ui::MultiAnimation> settings_transition_animation_; | 140 scoped_ptr<ui::MultiAnimation> settings_transition_animation_; |
| 131 | 141 |
| 132 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); | 142 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); |
| 133 }; | 143 }; |
| 134 | 144 |
| 135 } // namespace message_center | 145 } // namespace message_center |
| 136 | 146 |
| 137 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 147 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
| OLD | NEW |