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

Unified Diff: ui/message_center/notification_list.cc

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the ever-changing Mac unit tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/notification_list.h ('k') | ui/message_center/notification_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/notification_list.cc
diff --git a/ui/message_center/notification_list.cc b/ui/message_center/notification_list.cc
index a0a33f35961bbfd5704f45a9f87cf9245380f8ec..8770ee793c7f3ac594ac24a6651c7cbfb9a6549d 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -71,17 +71,22 @@ void NotificationList::SetMessageCenterVisible(
}
}
-void NotificationList::AddNotification(
- NotificationType type,
- const std::string& id,
- const string16& title,
- const string16& message,
- const string16& display_source,
- const std::string& extension_id,
- const DictionaryValue* optional_fields) {
- scoped_ptr<Notification> notification(
- new Notification(type, id, title, message, display_source, extension_id,
- optional_fields));
+void NotificationList::AddNotification(NotificationType type,
+ const std::string& id,
+ const string16& title,
+ const string16& message,
+ const string16& display_source,
+ const std::string& extension_id,
+ const DictionaryValue* optional_fields,
+ NotificationDelegate* delegate) {
+ scoped_ptr<Notification> notification(new Notification(type,
+ id,
+ title,
+ message,
+ display_source,
+ extension_id,
+ optional_fields,
+ delegate));
PushNotification(notification.Pass());
}
@@ -90,7 +95,8 @@ void NotificationList::UpdateNotificationMessage(
const std::string& new_id,
const string16& title,
const string16& message,
- const base::DictionaryValue* optional_fields) {
+ const base::DictionaryValue* optional_fields,
+ NotificationDelegate* delegate) {
Notifications::iterator iter = GetNotification(old_id);
if (iter == notifications_.end())
return;
@@ -104,7 +110,8 @@ void NotificationList::UpdateNotificationMessage(
message,
(*iter)->display_source(),
(*iter)->extension_id(),
- optional_fields));
+ optional_fields,
+ delegate));
notification->CopyState(*iter);
// Handles priority promotion. If the notification is already dismissed but
@@ -285,6 +292,14 @@ void NotificationList::MarkNotificationAsExpanded(const std::string& id) {
(*iter)->set_is_expanded(true);
}
+NotificationDelegate* NotificationList::GetNotificationDelegate(
+ const std::string& id) {
+ Notifications::iterator iter = GetNotification(id);
+ if (iter == notifications_.end())
+ return NULL;
+ return (*iter)->delegate();
+}
+
void NotificationList::SetQuietMode(bool quiet_mode) {
SetQuietModeInternal(quiet_mode);
quiet_mode_timer_.reset();
« no previous file with comments | « ui/message_center/notification_list.h ('k') | ui/message_center/notification_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698