| 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 | 8 |
| 9 #include "ui/gfx/animation/animation_delegate.h" | 9 #include "ui/gfx/animation/animation_delegate.h" |
| 10 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
| 11 #include "ui/message_center/message_center_observer.h" | 11 #include "ui/message_center/message_center_observer.h" |
| 12 #include "ui/message_center/notification_list.h" | 12 #include "ui/message_center/notification_list.h" |
| 13 #include "ui/message_center/views/message_center_controller.h" | 13 #include "ui/message_center/views/message_center_controller.h" |
| 14 #include "ui/message_center/views/message_view.h" | 14 #include "ui/message_center/views/message_view.h" |
| 15 #include "ui/views/controls/button/button.h" | 15 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class MultiAnimation; | 19 class MultiAnimation; |
| 20 } // namespace gfx | 20 } // namespace gfx |
| 21 | 21 |
| 22 namespace views { | 22 namespace views { |
| 23 class Button; | 23 class Button; |
| 24 } // namespace views | 24 } // namespace views |
| 25 | 25 |
| 26 namespace message_center { | 26 namespace message_center { |
| 27 | 27 |
| 28 class GroupView; | |
| 29 class MessageCenter; | 28 class MessageCenter; |
| 30 class MessageCenterBubble; | 29 class MessageCenterBubble; |
| 31 class NotificationCenterButton; | 30 class NotificationCenterButton; |
| 32 class MessageCenterButtonBar; | 31 class MessageCenterButtonBar; |
| 33 class MessageCenterTray; | 32 class MessageCenterTray; |
| 34 class MessageCenterView; | 33 class MessageCenterView; |
| 35 class MessageView; | 34 class MessageView; |
| 36 class MessageViewContextMenuController; | 35 class MessageViewContextMenuController; |
| 37 class MessageListView; | 36 class MessageListView; |
| 38 class NotificationView; | 37 class NotificationView; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 82 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; |
| 84 virtual void RemoveNotification(const std::string& notification_id, | 83 virtual void RemoveNotification(const std::string& notification_id, |
| 85 bool by_user) OVERRIDE; | 84 bool by_user) OVERRIDE; |
| 86 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( | 85 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( |
| 87 const NotifierId& notifier_id, | 86 const NotifierId& notifier_id, |
| 88 const base::string16& display_source) OVERRIDE; | 87 const base::string16& display_source) OVERRIDE; |
| 89 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; | 88 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; |
| 90 virtual void ClickOnNotificationButton(const std::string& notification_id, | 89 virtual void ClickOnNotificationButton(const std::string& notification_id, |
| 91 int button_index) OVERRIDE; | 90 int button_index) OVERRIDE; |
| 92 virtual void ExpandNotification(const std::string& notification_id) OVERRIDE; | 91 virtual void ExpandNotification(const std::string& notification_id) OVERRIDE; |
| 93 virtual void GroupBodyClicked(const std::string& last_notification_id) | |
| 94 OVERRIDE; | |
| 95 virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE; | |
| 96 virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE; | |
| 97 | 92 |
| 98 // Overridden from gfx::AnimationDelegate: | 93 // Overridden from gfx::AnimationDelegate: |
| 99 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 94 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
| 100 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 95 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| 101 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; | 96 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; |
| 102 | 97 |
| 103 private: | 98 private: |
| 104 friend class MessageCenterViewTest; | 99 friend class MessageCenterViewTest; |
| 105 | 100 |
| 106 void AddMessageViewAt(MessageView* view, int index); | 101 void AddMessageViewAt(MessageView* view, int index); |
| 107 void AddGroupPlaceholder(const NotifierId& group_id, | |
| 108 const Notification& notification, | |
| 109 const gfx::ImageSkia& group_icon, | |
| 110 int group_size, | |
| 111 int index); | |
| 112 void AddNotificationAt(const Notification& notification, int index); | 102 void AddNotificationAt(const Notification& notification, int index); |
| 113 void NotificationsChanged(); | 103 void NotificationsChanged(); |
| 114 void SetNotificationViewForTest(MessageView* view); | 104 void SetNotificationViewForTest(MessageView* view); |
| 115 | 105 |
| 116 MessageCenter* message_center_; // Weak reference. | 106 MessageCenter* message_center_; // Weak reference. |
| 117 MessageCenterTray* tray_; // Weak reference. | 107 MessageCenterTray* tray_; // Weak reference. |
| 118 | 108 |
| 119 // Map notification_id->NotificationView*. It contains all NotificaitonViews | 109 // Map notification_id->NotificationView*. It contains all NotificaitonViews |
| 120 // currently displayed in MessageCenter. | 110 // currently displayed in MessageCenter. |
| 121 typedef std::map<std::string, NotificationView*> NotificationViewsMap; | 111 typedef std::map<std::string, NotificationView*> NotificationViewsMap; |
| 122 NotificationViewsMap notification_views_; // Weak. | 112 NotificationViewsMap notification_views_; // Weak. |
| 123 | 113 |
| 124 // List of all GroupViews. GroupView is responsible for multiple Notifications | |
| 125 // from the same source. | |
| 126 typedef std::list<GroupView*> GroupViews; | |
| 127 GroupViews group_views_; // Weak. | |
| 128 | |
| 129 // Child views. | 114 // Child views. |
| 130 views::ScrollView* scroller_; | 115 views::ScrollView* scroller_; |
| 131 scoped_ptr<MessageListView> message_list_view_; | 116 scoped_ptr<MessageListView> message_list_view_; |
| 132 scoped_ptr<views::View> empty_list_view_; | 117 scoped_ptr<views::View> empty_list_view_; |
| 133 NotifierSettingsView* settings_view_; | 118 NotifierSettingsView* settings_view_; |
| 134 MessageCenterButtonBar* button_bar_; | 119 MessageCenterButtonBar* button_bar_; |
| 135 bool top_down_; | 120 bool top_down_; |
| 136 | 121 |
| 137 // Data for transition animation between settings view and message list. | 122 // Data for transition animation between settings view and message list. |
| 138 bool settings_visible_; | 123 bool settings_visible_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 153 bool is_closing_; | 138 bool is_closing_; |
| 154 | 139 |
| 155 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; | 140 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; |
| 156 | 141 |
| 157 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); | 142 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); |
| 158 }; | 143 }; |
| 159 | 144 |
| 160 } // namespace message_center | 145 } // namespace message_center |
| 161 | 146 |
| 162 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 147 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
| OLD | NEW |