diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 21:24:53 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 21:24:53 +0000 |
commit | a1bdc5d2164380a4519de404533b56fefac21f46 (patch) | |
tree | aabb140e95e2dfbf06ce6bdb685fde9ec3648975 /ash/system | |
parent | b9a9ff8678651a717d964983185015c82c81c754 (diff) | |
download | chromium_src-a1bdc5d2164380a4519de404533b56fefac21f46.zip chromium_src-a1bdc5d2164380a4519de404533b56fefac21f46.tar.gz chromium_src-a1bdc5d2164380a4519de404533b56fefac21f46.tar.bz2 |
Uses --enable-rich-notifications for new design message center.
BUG=172333
TEST=compilation succeeds
Review URL: https://chromiumcodereview.appspot.com/12187003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index b3e8df4..a6d92e7 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -20,6 +20,7 @@ #include "ui/message_center/message_bubble_base.h" #include "ui/message_center/message_center_bubble.h" #include "ui/message_center/message_center_tray_delegate.h" +#include "ui/message_center/message_center_util.h" #include "ui/message_center/message_popup_bubble.h" #include "ui/message_center/quiet_mode_bubble.h" #include "ui/views/bubble/tray_bubble_view.h" @@ -213,10 +214,13 @@ void WebNotificationTray::ShowQuietModeBubble() { void WebNotificationTray::UpdateAfterLoginStatusChange( user::LoginStatus login_status) { - // The status icon should be always visible except for lock screen / login - // screen, to allow quiet mode and settings. - SetVisible((login_status != user::LOGGED_IN_NONE) && - (login_status != user::LOGGED_IN_LOCKED)); + 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_ = @@ -368,6 +372,17 @@ void WebNotificationTray::OnMessageCenterTrayChanged() { 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); + } Layout(); SchedulePaint(); } |