| 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_) {
|
|
|