| 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 06a04611514ce0837d61e6da1f97a324dceb367a..1cd3bf7f88ec02208176dc8606f5a4d373005689 100644
|
| --- a/ui/message_center/message_center_impl.cc
|
| +++ b/ui/message_center/message_center_impl.cc
|
| @@ -441,13 +441,17 @@ void MessageCenterImpl::NotifierEnabledChanged(
|
|
|
| void MessageCenterImpl::SetVisibility(Visibility visibility) {
|
| std::set<std::string> updated_ids;
|
| - notification_list_->SetMessageCenterVisible(
|
| - (visibility == VISIBILITY_MESSAGE_CENTER), &updated_ids);
|
| - notification_cache_.RecountUnread();
|
| + bool visible = visibility == VISIBILITY_MESSAGE_CENTER;
|
|
|
| - for (const auto& id : updated_ids) {
|
| - FOR_EACH_OBSERVER(
|
| - MessageCenterObserver, observer_list_, OnNotificationUpdated(id));
|
| + notification_list_->SetMessageCenterVisible(visible);
|
| + if (visible && !locked_) {
|
| + notification_list_->SetNotificationsShown(blockers_, &updated_ids);
|
| + notification_cache_.RecountUnread();
|
| +
|
| + for (const auto& id : updated_ids) {
|
| + FOR_EACH_OBSERVER(
|
| + MessageCenterObserver, observer_list_, OnNotificationUpdated(id));
|
| + }
|
| }
|
|
|
| if (notification_queue_ &&
|
| @@ -481,6 +485,10 @@ bool MessageCenterImpl::IsQuietMode() const {
|
| return notification_list_->quiet_mode();
|
| }
|
|
|
| +bool MessageCenterImpl::IsLockedState() const {
|
| + return locked_;
|
| +}
|
| +
|
| bool MessageCenterImpl::HasClickedListener(const std::string& id) {
|
| scoped_refptr<NotificationDelegate> delegate =
|
| notification_list_->GetNotificationDelegate(id);
|
| @@ -854,6 +862,14 @@ void MessageCenterImpl::SetQuietMode(bool in_quiet_mode) {
|
| 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_) {
|
|
|