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

Unified Diff: chrome/browser/notifications/notification_ui_manager_impl.cc

Issue 11958025: Start delegating notifications to MessageCenter on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix androif build Created 7 years, 11 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
Index: chrome/browser/notifications/notification_ui_manager_impl.cc
diff --git a/chrome/browser/notifications/notification_ui_manager_impl.cc b/chrome/browser/notifications/notification_ui_manager_impl.cc
index 79cfef76b459e07bcf3673ed26c456d5b576ca9d..075795526e68be2ad3633a3365f673126a5894b2 100644
--- a/chrome/browser/notifications/notification_ui_manager_impl.cc
+++ b/chrome/browser/notifications/notification_ui_manager_impl.cc
@@ -66,7 +66,7 @@ NotificationUIManagerImpl::~NotificationUIManagerImpl() {
void NotificationUIManagerImpl::Add(const Notification& notification,
Profile* profile) {
- if (TryReplacement(notification)) {
+ if (TryReplacement(notification, profile)) {
return;
}
@@ -161,7 +161,7 @@ void NotificationUIManagerImpl::ShowNotifications() {
}
bool NotificationUIManagerImpl::TryReplacement(
- const Notification& notification) {
+ const Notification& notification, Profile* profile) {
const GURL& origin = notification.origin_url();
const string16& replace_id = notification.replace_id();
@@ -172,7 +172,8 @@ bool NotificationUIManagerImpl::TryReplacement(
// Then check the list of notifications already being shown.
for (NotificationDeque::const_iterator iter = show_queue_.begin();
iter != show_queue_.end(); ++iter) {
- if (origin == (*iter)->notification().origin_url() &&
+ if (profile == (*iter)->profile() &&
+ origin == (*iter)->notification().origin_url() &&
replace_id == (*iter)->notification().replace_id()) {
(*iter)->Replace(notification);
return true;
@@ -180,7 +181,7 @@ bool NotificationUIManagerImpl::TryReplacement(
}
// Give the subclass the opportunity to update existing notification.
- return UpdateNotification(notification);
+ return UpdateNotification(notification, profile);
}
void NotificationUIManagerImpl::GetQueuedNotificationsForTesting(

Powered by Google App Engine
This is Rietveld 408576698