summaryrefslogtreecommitdiffstats
path: root/ash/system/web_notification
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-03 23:52:14 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-03 23:52:14 +0000
commitcc713de3e381a2e8fb395f92ed3e3a14ea65369b (patch)
tree7cd403c7f64a6e84c9b197b7e3308800330a9793 /ash/system/web_notification
parent20c3d9b2d0f0abe1f948de6cefc5d14350cc4fc0 (diff)
downloadchromium_src-cc713de3e381a2e8fb395f92ed3e3a14ea65369b.zip
chromium_src-cc713de3e381a2e8fb395f92ed3e3a14ea65369b.tar.gz
chromium_src-cc713de3e381a2e8fb395f92ed3e3a14ea65369b.tar.bz2
Sets web_notification tray icon invisible if there're no notifications.
Previously the icon is always visible even if there are no notifications, but now it should be invisible in such case. BUG=237981 R=stevenjb@chromium.org Review URL: https://codereview.chromium.org/14645024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/web_notification')
-rw-r--r--ash/system/web_notification/web_notification_tray.cc23
1 files changed, 4 insertions, 19 deletions
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 541f213..65e0a83 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -331,14 +331,6 @@ bool WebNotificationTray::ShouldShowQuietModeMenu(const ui::Event& event) {
void WebNotificationTray::UpdateAfterLoginStatusChange(
user::LoginStatus login_status) {
- if (message_center::IsRichNotificationEnabled()) {
- // The status icon should be always visible except for lock screen / login
- // screen, to allow quiet mode and settings. This is valid only when rich
- // notification is enabled, since old UI doesn't have settings.
- SetVisible((login_status != user::LOGGED_IN_NONE) &&
- (login_status != user::LOGGED_IN_LOCKED));
- }
-
if (login_status == user::LOGGED_IN_LOCKED) {
show_message_center_on_unlock_ =
message_center_tray_->HideMessageCenterBubble();
@@ -350,6 +342,7 @@ void WebNotificationTray::UpdateAfterLoginStatusChange(
message_center_tray_->ShowMessageCenterBubble();
show_message_center_on_unlock_ = false;
}
+ OnMessageCenterTrayChanged();
}
bool WebNotificationTray::ShouldBlockLauncherAutoHide() const {
@@ -486,17 +479,9 @@ void WebNotificationTray::UpdateTrayContent() {
button_->SetState(views::CustomButton::STATE_PRESSED);
else
button_->SetState(views::CustomButton::STATE_NORMAL);
- // Change the visibility of the buttons here when rich notifications are not
- // enabled. If rich notifications are enabled, the visibility is changed at
- // UpdateAfterLoginStatusChange() since the visibility won't depend on the
- // number of notifications.
- if (!message_center::IsRichNotificationEnabled()) {
- bool is_visible =
- (status_area_widget()->login_status() != user::LOGGED_IN_NONE) &&
- (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) &&
- (message_center->NotificationCount() > 0);
- SetVisible(is_visible);
- }
+ SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) &&
+ (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) &&
+ (message_center->NotificationCount() > 0));
Layout();
SchedulePaint();
}