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

Unified Diff: ui/message_center/message_center.cc

Issue 12277024: Notificaitons refactor step 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more feedback from Steven Created 7 years, 10 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/message_center.h ('k') | ui/message_center/message_center.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center.cc
diff --git a/ui/message_center/message_center.cc b/ui/message_center/message_center.cc
index 02ea67e5dc8a687b3c81bc02d1dabe50146b176e..9ef0bc30c8cb77c54de367e096510af286d4a07e 100644
--- a/ui/message_center/message_center.cc
+++ b/ui/message_center/message_center.cc
@@ -7,6 +7,8 @@
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
+#include "ui/message_center/notification.h"
+#include "ui/message_center/notification_list.h"
namespace message_center {
@@ -52,7 +54,7 @@ bool MessageCenter::HasPopupNotifications() const {
// Client code interface.
void MessageCenter::AddNotification(
- ui::notifications::NotificationType type,
+ NotificationType type,
const std::string& id,
const string16& title,
const string16& message,
@@ -76,8 +78,7 @@ void MessageCenter::UpdateNotification(
}
void MessageCenter::RemoveNotification(const std::string& id) {
- if (!notification_list_->RemoveNotification(id))
- return;
+ notification_list_->RemoveNotification(id);
NotifyMessageCenterChanged(false);
}
@@ -111,13 +112,13 @@ void MessageCenter::SendRemoveNotification(const std::string& id) {
void MessageCenter::SendRemoveAllNotifications() {
if (delegate_) {
- NotificationList::Notifications notifications;
- notification_list_->GetNotifications(&notifications);
+ const NotificationList::Notifications& notifications =
+ notification_list_->GetNotifications();
for (NotificationList::Notifications::const_iterator loopiter =
notifications.begin();
loopiter != notifications.end(); ) {
NotificationList::Notifications::const_iterator curiter = loopiter++;
- std::string notification_id = curiter->id;
+ std::string notification_id = (*curiter)->id();
// May call RemoveNotification and erase curiter.
delegate_->NotificationRemoved(notification_id);
}
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/message_center.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698