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

Unified Diff: ui/message_center/message_center_impl.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/message_center_impl.h ('k') | ui/message_center/message_center_observer.h » ('j') | 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 67d62d40cce2c2ecc21d762b0e8ac152c2441a39..06a04611514ce0837d61e6da1f97a324dceb367a 100644
--- a/ui/message_center/message_center_impl.cc
+++ b/ui/message_center/message_center_impl.cc
@@ -356,7 +356,7 @@
: MessageCenter(),
popup_timers_controller_(new PopupTimersController(this)),
settings_provider_(NULL) {
- notification_list_.reset(new NotificationList(this));
+ notification_list_.reset(new NotificationList());
bool enable_message_center_changes_while_open = true; // enable by default
std::string arg = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
@@ -440,17 +440,14 @@
}
void MessageCenterImpl::SetVisibility(Visibility visibility) {
- visible_ = (visibility == VISIBILITY_MESSAGE_CENTER);
-
- if (visible_ && !locked_) {
- std::set<std::string> updated_ids;
- notification_list_->SetNotificationsShown(blockers_, &updated_ids);
- notification_cache_.RecountUnread();
-
- for (const auto& id : updated_ids) {
- FOR_EACH_OBSERVER(
- MessageCenterObserver, observer_list_, OnNotificationUpdated(id));
- }
+ std::set<std::string> updated_ids;
+ notification_list_->SetMessageCenterVisible(
+ (visibility == VISIBILITY_MESSAGE_CENTER), &updated_ids);
+ notification_cache_.RecountUnread();
+
+ for (const auto& id : updated_ids) {
+ FOR_EACH_OBSERVER(
+ MessageCenterObserver, observer_list_, OnNotificationUpdated(id));
}
if (notification_queue_ &&
@@ -464,7 +461,7 @@
}
bool MessageCenterImpl::IsMessageCenterVisible() const {
- return visible_;
+ return notification_list_->is_message_center_visible();
}
size_t MessageCenterImpl::NotificationCount() const {
@@ -482,10 +479,6 @@
bool MessageCenterImpl::IsQuietMode() const {
return notification_list_->quiet_mode();
-}
-
-bool MessageCenterImpl::IsLockedState() const {
- return locked_;
}
bool MessageCenterImpl::HasClickedListener(const std::string& id) {
@@ -523,7 +516,8 @@
for (size_t i = 0; i < blockers_.size(); ++i)
blockers_[i]->CheckState();
- if (notification_queue_ && visible_) {
+ if (notification_queue_ &&
+ notification_list_->is_message_center_visible()) {
notification_queue_->AddNotification(std::move(notification));
return;
}
@@ -558,7 +552,8 @@
for (size_t i = 0; i < blockers_.size(); ++i)
blockers_[i]->CheckState();
- if (notification_queue_ && visible_) {
+ if (notification_queue_ &&
+ notification_list_->is_message_center_visible()) {
// We will allow notifications that are progress types (and stay progress
// types) to be updated even if the message center is open. There are 3
// requirements here:
@@ -606,7 +601,8 @@
void MessageCenterImpl::RemoveNotification(const std::string& id,
bool by_user) {
- if (notification_queue_ && !by_user && visible_) {
+ if (notification_queue_ && !by_user &&
+ notification_list_->is_message_center_visible()) {
notification_queue_->EraseNotification(id, by_user);
return;
}
@@ -858,14 +854,6 @@
quiet_mode_timer_.reset();
}
-void MessageCenterImpl::SetLockedState(bool locked) {
- if (locked != locked_) {
- locked_ = locked;
- FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
- OnLockedStateChanged(locked));
- }
-}
-
void MessageCenterImpl::EnterQuietModeWithExpire(
const base::TimeDelta& expires_in) {
if (quiet_mode_timer_) {
« no previous file with comments | « ui/message_center/message_center_impl.h ('k') | ui/message_center/message_center_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698