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

Unified Diff: ui/message_center/notification_list.cc

Issue 1986493002: Show message center on lock screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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 14abd9b5c420b4a5994288acd9524248ec2a3ff5..0ac3b1cbb8b07d68ae42e5a5565bc5e8b11af0b1 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -12,6 +12,7 @@
#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"
@@ -54,8 +55,8 @@ bool CompareTimestampSerial::operator()(Notification* n1, Notification* n2) {
return false;
}
-NotificationList::NotificationList()
- : message_center_visible_(false),
+NotificationList::NotificationList(MessageCenter* message_center)
+ : message_center_(message_center),
quiet_mode_(false) {
}
@@ -63,19 +64,12 @@ NotificationList::~NotificationList() {
STLDeleteContainerPointers(notifications_.begin(), notifications_.end());
}
-void NotificationList::SetMessageCenterVisible(
- bool visible,
+void NotificationList::SetNotificationsShown(
+ const NotificationBlockers& blockers,
std::set<std::string>* updated_ids) {
- if (message_center_visible_ == visible)
- return;
-
- message_center_visible_ = visible;
-
- if (!visible)
- return;
+ Notifications notifications = GetVisibleNotifications(blockers);
- for (Notifications::iterator iter = notifications_.begin();
- iter != notifications_.end(); ++iter) {
+ for (auto iter = notifications.begin(); iter != notifications.end(); ++iter) {
Notification* notification = *iter;
bool was_popup = notification->shown_as_popup();
bool was_read = notification->IsRead();
@@ -346,7 +340,7 @@ void NotificationList::PushNotification(
// 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_visible_
+ notification->set_shown_as_popup(message_center_->IsMessageCenterVisible()
dewittj 2016/05/24 17:10:29 This is ok for now, but I'd rather the notificatio
yoshiki 2016/05/25 09:13:59 Got it. Let me consider a good way.
|| 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