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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Overridden from MessageCenterObserver: | 73 // Overridden from MessageCenterObserver: |
74 void OnNotificationAdded(const std::string& id) override; | 74 void OnNotificationAdded(const std::string& id) override; |
75 void OnNotificationRemoved(const std::string& id, bool by_user) override; | 75 void OnNotificationRemoved(const std::string& id, bool by_user) override; |
76 void OnNotificationUpdated(const std::string& id) override; | 76 void OnNotificationUpdated(const std::string& id) override; |
77 | 77 |
78 // Overridden from MessageCenterController: | 78 // Overridden from MessageCenterController: |
79 void ClickOnNotification(const std::string& notification_id) override; | 79 void ClickOnNotification(const std::string& notification_id) override; |
80 void RemoveNotification(const std::string& notification_id, | 80 void RemoveNotification(const std::string& notification_id, |
81 bool by_user) override; | 81 bool by_user) override; |
82 scoped_ptr<ui::MenuModel> CreateMenuModel( | 82 std::unique_ptr<ui::MenuModel> CreateMenuModel( |
83 const NotifierId& notifier_id, | 83 const NotifierId& notifier_id, |
84 const base::string16& display_source) override; | 84 const base::string16& display_source) override; |
85 bool HasClickedListener(const std::string& notification_id) override; | 85 bool HasClickedListener(const std::string& notification_id) override; |
86 void ClickOnNotificationButton(const std::string& notification_id, | 86 void ClickOnNotificationButton(const std::string& notification_id, |
87 int button_index) override; | 87 int button_index) override; |
88 void ClickOnSettingsButton(const std::string& notification_id) override; | 88 void ClickOnSettingsButton(const std::string& notification_id) override; |
89 | 89 |
90 // Overridden from gfx::AnimationDelegate: | 90 // Overridden from gfx::AnimationDelegate: |
91 void AnimationEnded(const gfx::Animation* animation) override; | 91 void AnimationEnded(const gfx::Animation* animation) override; |
92 void AnimationProgressed(const gfx::Animation* animation) override; | 92 void AnimationProgressed(const gfx::Animation* animation) override; |
93 void AnimationCanceled(const gfx::Animation* animation) override; | 93 void AnimationCanceled(const gfx::Animation* animation) override; |
94 | 94 |
95 private: | 95 private: |
96 friend class MessageCenterViewTest; | 96 friend class MessageCenterViewTest; |
97 | 97 |
98 void AddNotificationAt(const Notification& notification, int index); | 98 void AddNotificationAt(const Notification& notification, int index); |
99 void NotificationsChanged(); | 99 void NotificationsChanged(); |
100 void SetNotificationViewForTest(MessageView* view); | 100 void SetNotificationViewForTest(MessageView* view); |
101 | 101 |
102 MessageCenter* message_center_; // Weak reference. | 102 MessageCenter* message_center_; // Weak reference. |
103 MessageCenterTray* tray_; // Weak reference. | 103 MessageCenterTray* tray_; // Weak reference. |
104 | 104 |
105 // Map notification_id->NotificationView*. It contains all NotificationViews | 105 // Map notification_id->NotificationView*. It contains all NotificationViews |
106 // currently displayed in MessageCenter. | 106 // currently displayed in MessageCenter. |
107 typedef std::map<std::string, NotificationView*> NotificationViewsMap; | 107 typedef std::map<std::string, NotificationView*> NotificationViewsMap; |
108 NotificationViewsMap notification_views_; // Weak. | 108 NotificationViewsMap notification_views_; // Weak. |
109 | 109 |
110 // Child views. | 110 // Child views. |
111 views::ScrollView* scroller_; | 111 views::ScrollView* scroller_; |
112 scoped_ptr<MessageListView> message_list_view_; | 112 std::unique_ptr<MessageListView> message_list_view_; |
113 scoped_ptr<views::View> empty_list_view_; | 113 std::unique_ptr<views::View> empty_list_view_; |
114 NotifierSettingsView* settings_view_; | 114 NotifierSettingsView* settings_view_; |
115 MessageCenterButtonBar* button_bar_; | 115 MessageCenterButtonBar* button_bar_; |
116 bool top_down_; | 116 bool top_down_; |
117 | 117 |
118 // Data for transition animation between settings view and message list. | 118 // Data for transition animation between settings view and message list. |
119 bool settings_visible_; | 119 bool settings_visible_; |
120 | 120 |
121 // Animation managing transition between message center and settings (and vice | 121 // Animation managing transition between message center and settings (and vice |
122 // versa). | 122 // versa). |
123 scoped_ptr<gfx::MultiAnimation> settings_transition_animation_; | 123 std::unique_ptr<gfx::MultiAnimation> settings_transition_animation_; |
124 | 124 |
125 // Helper data to keep track of the transition between settings and | 125 // Helper data to keep track of the transition between settings and |
126 // message center views. | 126 // message center views. |
127 views::View* source_view_; | 127 views::View* source_view_; |
128 int source_height_; | 128 int source_height_; |
129 views::View* target_view_; | 129 views::View* target_view_; |
130 int target_height_; | 130 int target_height_; |
131 | 131 |
132 // True when the widget is closing so that further operations should be | 132 // True when the widget is closing so that further operations should be |
133 // ignored. | 133 // ignored. |
134 bool is_closing_; | 134 bool is_closing_; |
135 | 135 |
136 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; | 136 std::unique_ptr<MessageViewContextMenuController> context_menu_controller_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); | 138 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace message_center | 141 } // namespace message_center |
142 | 142 |
143 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 143 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
OLD | NEW |