Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: ui/message_center/notification_list.h

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win browsertests. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_NOTIFICATION_LIST_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/timer.h" 13 #include "base/timer.h"
14 #include "ui/gfx/image/image.h" 14 #include "ui/gfx/image/image.h"
15 #include "ui/gfx/native_widget_types.h" 15 #include "ui/gfx/native_widget_types.h"
16 #include "ui/message_center/message_center_export.h" 16 #include "ui/message_center/message_center_export.h"
17 #include "ui/message_center/notification.h" 17 #include "ui/message_center/notification.h"
18 #include "ui/message_center/notification_types.h" 18 #include "ui/message_center/notification_types.h"
19 19
20 namespace base { 20 namespace base {
21 class DictionaryValue; 21 class DictionaryValue;
22 } 22 }
23 23
24 namespace message_center { 24 namespace message_center {
25
26 class NotificationDelegate;
27
25 namespace test { 28 namespace test {
26 class NotificationListTest; 29 class NotificationListTest;
27 } 30 }
28 31
29 // Comparers used to auto-sort the lists of Notifications. 32 // Comparers used to auto-sort the lists of Notifications.
30 struct MESSAGE_CENTER_EXPORT ComparePriorityTimestampSerial { 33 struct MESSAGE_CENTER_EXPORT ComparePriorityTimestampSerial {
31 bool operator()(Notification* n1, Notification* n2); 34 bool operator()(Notification* n1, Notification* n2);
32 }; 35 };
33 36
34 struct CompareTimestampSerial { 37 struct CompareTimestampSerial {
(...skipping 19 matching lines...) Expand all
54 // ids don't matter. 57 // ids don't matter.
55 void SetMessageCenterVisible(bool visible, 58 void SetMessageCenterVisible(bool visible,
56 std::set<std::string>* updated_ids); 59 std::set<std::string>* updated_ids);
57 60
58 void AddNotification(NotificationType type, 61 void AddNotification(NotificationType type,
59 const std::string& id, 62 const std::string& id,
60 const string16& title, 63 const string16& title,
61 const string16& message, 64 const string16& message,
62 const string16& display_source, 65 const string16& display_source,
63 const std::string& extension_id, 66 const std::string& extension_id,
64 const base::DictionaryValue* optional_fields); 67 const base::DictionaryValue* optional_fields,
68 NotificationDelegate* delegate);
65 69
66 void UpdateNotificationMessage(const std::string& old_id, 70 void UpdateNotificationMessage(const std::string& old_id,
67 const std::string& new_id, 71 const std::string& new_id,
68 const string16& title, 72 const string16& title,
69 const string16& message, 73 const string16& message,
70 const base::DictionaryValue* optional_fields); 74 const base::DictionaryValue* optional_fields);
71 75
72 void RemoveNotification(const std::string& id); 76 void RemoveNotification(const std::string& id);
73 77
74 void RemoveAllNotifications(); 78 void RemoveAllNotifications();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // true in case marking the notification as read too. 112 // true in case marking the notification as read too.
109 void MarkSinglePopupAsShown(const std::string& id, 113 void MarkSinglePopupAsShown(const std::string& id,
110 bool mark_notification_as_read); 114 bool mark_notification_as_read);
111 115
112 // Marks a specific popup item as displayed. 116 // Marks a specific popup item as displayed.
113 void MarkSinglePopupAsDisplayed(const std::string& id); 117 void MarkSinglePopupAsDisplayed(const std::string& id);
114 118
115 // Marks the specified notification as expanded in the notification center. 119 // Marks the specified notification as expanded in the notification center.
116 void MarkNotificationAsExpanded(const std::string& id); 120 void MarkNotificationAsExpanded(const std::string& id);
117 121
122 NotificationDelegate* GetNotificationDelegate(const std::string& id);
123
118 bool quiet_mode() const { return quiet_mode_; } 124 bool quiet_mode() const { return quiet_mode_; }
119 125
120 // Sets the current quiet mode status to |quiet_mode|. The new status is not 126 // Sets the current quiet mode status to |quiet_mode|. The new status is not
121 // expired. 127 // expired.
122 void SetQuietMode(bool quiet_mode); 128 void SetQuietMode(bool quiet_mode);
123 129
124 // Sets the current quiet mode to true. The quiet mode will expire in the 130 // Sets the current quiet mode to true. The quiet mode will expire in the
125 // specified time-delta from now. 131 // specified time-delta from now.
126 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in); 132 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in);
127 133
(...skipping 21 matching lines...) Expand all
149 size_t unread_count_; 155 size_t unread_count_;
150 bool quiet_mode_; 156 bool quiet_mode_;
151 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_; 157 scoped_ptr<base::OneShotTimer<NotificationList> > quiet_mode_timer_;
152 158
153 DISALLOW_COPY_AND_ASSIGN(NotificationList); 159 DISALLOW_COPY_AND_ASSIGN(NotificationList);
154 }; 160 };
155 161
156 } // namespace message_center 162 } // namespace message_center
157 163
158 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ 164 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698