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

Unified Diff: ash/system/chromeos/session/tray_session_length_limit.cc

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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: ash/system/chromeos/session/tray_session_length_limit.cc
diff --git a/ash/system/chromeos/session/tray_session_length_limit.cc b/ash/system/chromeos/session/tray_session_length_limit.cc
index 6666c021c3b61d0a8ebbed1ebdd8c8d8d6b97d55..136c75bb361185570709027f83197898d21ba5d7 100644
--- a/ash/system/chromeos/session/tray_session_length_limit.cc
+++ b/ash/system/chromeos/session/tray_session_length_limit.cc
@@ -123,7 +123,7 @@ void TraySessionLengthLimit::UpdateNotification() {
// If state hasn't changed and the notification has already been acknowledged,
// we won't re-create it.
if (limit_state_ == last_limit_state_ &&
- !message_center->HasNotification(kNotificationId)) {
+ message_center->FindVisibleNotificationById(kNotificationId) == NULL) {
return;
}
@@ -132,7 +132,7 @@ void TraySessionLengthLimit::UpdateNotification() {
// (and in the rare case of state change towards LIMIT_NONE to make the
// notification disappear).
if (limit_state_ != last_limit_state_ &&
- message_center->HasNotification(kNotificationId)) {
+ message_center->FindVisibleNotificationById(kNotificationId) != NULL) {
message_center::MessageCenter::Get()->RemoveNotification(
kNotificationId, false /* by_user */);
}
@@ -162,7 +162,7 @@ void TraySessionLengthLimit::UpdateNotification() {
data,
NULL /* delegate */));
notification->SetSystemPriority();
- if (message_center->HasNotification(kNotificationId))
+ if (message_center->FindVisibleNotificationById(kNotificationId) != NULL)
message_center->UpdateNotification(kNotificationId, notification.Pass());
else
message_center->AddNotification(notification.Pass());

Powered by Google App Engine
This is Rietveld 408576698