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

Unified Diff: ui/message_center/notification_list.cc

Issue 2018063002: Revert of Show message center on lock screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 0ac3b1cbb8b07d68ae42e5a5565bc5e8b11af0b1..14abd9b5c420b4a5994288acd9524248ec2a3ff5 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -12,7 +12,6 @@
#include "base/time/time.h"
#include "base/values.h"
#include "ui/gfx/image/image.h"
-#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_style.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_blocker.h"
@@ -55,8 +54,8 @@
return false;
}
-NotificationList::NotificationList(MessageCenter* message_center)
- : message_center_(message_center),
+NotificationList::NotificationList()
+ : message_center_visible_(false),
quiet_mode_(false) {
}
@@ -64,12 +63,19 @@
STLDeleteContainerPointers(notifications_.begin(), notifications_.end());
}
-void NotificationList::SetNotificationsShown(
- const NotificationBlockers& blockers,
+void NotificationList::SetMessageCenterVisible(
+ bool visible,
std::set<std::string>* updated_ids) {
- Notifications notifications = GetVisibleNotifications(blockers);
-
- for (auto iter = notifications.begin(); iter != notifications.end(); ++iter) {
+ if (message_center_visible_ == visible)
+ return;
+
+ message_center_visible_ = visible;
+
+ if (!visible)
+ return;
+
+ for (Notifications::iterator iter = notifications_.begin();
+ iter != notifications_.end(); ++iter) {
Notification* notification = *iter;
bool was_popup = notification->shown_as_popup();
bool was_read = notification->IsRead();
@@ -340,7 +346,7 @@
// TODO(mukai): needs to distinguish if a notification is dismissed by
// the quiet mode or user operation.
notification->set_is_read(false);
- notification->set_shown_as_popup(message_center_->IsMessageCenterVisible()
+ notification->set_shown_as_popup(message_center_visible_
|| quiet_mode_
|| notification->shown_as_popup());
}
« 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