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

Unified Diff: ui/message_center/message_center_impl.cc

Issue 2371693002: Not remove a pinned notification by user action (Closed)
Patch Set: Addressed the nit. Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_impl.cc
diff --git a/ui/message_center/message_center_impl.cc b/ui/message_center/message_center_impl.cc
index d4b81afc9347c1d40a5df5b40e4122c4ae97c42a..de7ef42160629681cc976480c3cadff9e9815041 100644
--- a/ui/message_center/message_center_impl.cc
+++ b/ui/message_center/message_center_impl.cc
@@ -616,7 +616,11 @@ void MessageCenterImpl::RemoveNotification(const std::string& id,
void MessageCenterImpl::RemoveNotificationImmediately(
const std::string& id, bool by_user) {
- if (FindVisibleNotificationById(id) == NULL)
+ Notification* notification = FindVisibleNotificationById(id);
+ if (notification == NULL)
+ return;
+
+ if (by_user && notification->pinned())
return;
// In many cases |id| is a reference to an existing notification instance
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698