Commit 77d4a1e4 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Stop hiding UnifiedSystemTray on last notification

UnifiedSystemTray should not be hidden on the last notification removal,
which is different behavior from old NotificationTray.

TEST=manual
BUG=857336

Change-Id: I083d48455be19d591833a17c9514ca1dbfe6903b
Reviewed-on: https://chromium-review.googlesource.com/1124261Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572525}
parent d638a00b
......@@ -61,6 +61,7 @@ class UnifiedSystemTray::UiDelegate : public message_center::UiDelegate {
UnifiedSystemTray::UiDelegate::UiDelegate(UnifiedSystemTray* owner)
: owner_(owner) {
ui_controller_ = std::make_unique<message_center::UiController>(this);
ui_controller_->set_hide_on_last_notification(false);
popup_alignment_delegate_ =
std::make_unique<AshPopupAlignmentDelegate>(owner->shelf());
message_popup_collection_ =
......
......@@ -157,7 +157,8 @@ void UiController::OnBlockingStateChanged(NotificationBlocker* blocker) {
}
void UiController::OnMessageCenterChanged() {
if (message_center_visible_ && message_center_->NotificationCount() == 0) {
if (hide_on_last_notification_ && message_center_visible_ &&
message_center_->NotificationCount() == 0) {
HideMessageCenterBubble();
return;
}
......
......@@ -54,6 +54,9 @@ class MESSAGE_CENTER_EXPORT UiController : public MessageCenterObserver {
UiDelegate* delegate() { return delegate_; }
const MessageCenter* message_center() const { return message_center_; }
MessageCenter* message_center() { return message_center_; }
void set_hide_on_last_notification(bool hide_on_last_notification) {
hide_on_last_notification_ = hide_on_last_notification;
}
// Overridden from MessageCenterObserver:
void OnNotificationAdded(const std::string& notification_id) override;
......@@ -80,6 +83,9 @@ class MESSAGE_CENTER_EXPORT UiController : public MessageCenterObserver {
bool popups_visible_ = false;
UiDelegate* delegate_;
// Set true to hide MessageCenterView when the last notification is dismissed.
bool hide_on_last_notification_ = true;
DISALLOW_COPY_AND_ASSIGN(UiController);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment