Chromium Code Reviews| Index: ash/system/web_notification/web_notification_tray.cc |
| diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc |
| index e26a5444d3f970265b681a653b9854354ac6d9ae..20d9149476cec9bb4d9735fed36f519a069d6f65 100644 |
| --- a/ash/system/web_notification/web_notification_tray.cc |
| +++ b/ash/system/web_notification/web_notification_tray.cc |
| @@ -395,8 +395,9 @@ void WebNotificationTray::HidePopups() { |
| // Private methods. |
| -bool WebNotificationTray::ShouldShowMessageCenter() { |
| - return Shell::Get()->system_tray_delegate()->ShouldShowNotificationTray(); |
| +bool WebNotificationTray::ShouldShowMessageCenter() const { |
| + // Hidden at login screen, during supervised user creation, etc. |
| + return Shell::Get()->session_controller()->ShouldShowNotificationTray(); |
| } |
| bool WebNotificationTray::ShouldBlockShelfAutoHide() const { |
| @@ -496,7 +497,7 @@ bool WebNotificationTray::ShowNotifierSettings() { |
| } |
| bool WebNotificationTray::IsContextMenuEnabled() const { |
| - return IsLoggedIn(); |
| + return ShouldShowMessageCenter(); |
|
James Cook
2017/04/17 23:21:13
This was probably wrong before. The context menu c
xiyuan
2017/04/18 16:26:29
Acknowledged.
|
| } |
| message_center::MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { |
| @@ -592,11 +593,11 @@ void WebNotificationTray::UpdateTrayContent() { |
| counter_->SetVisible(false); |
| } |
| - SetVisible(IsLoggedIn() && ShouldShowMessageCenter()); |
| + SetVisible(ShouldShowMessageCenter()); |
| PreferredSizeChanged(); |
| Layout(); |
| SchedulePaint(); |
| - if (IsLoggedIn()) |
| + if (ShouldShowMessageCenter()) |
|
James Cook
2017/04/17 23:21:13
It seemed weird to SetNextFocusableView() if |this
xiyuan
2017/04/18 16:26:29
Acknowledged.
|
| system_tray_->SetNextFocusableView(this); |
| } |
| @@ -612,12 +613,6 @@ message_center::MessageCenter* WebNotificationTray::message_center() const { |
| return message_center_tray_->message_center(); |
| } |
| -bool WebNotificationTray::IsLoggedIn() const { |
| - return Shell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| - LoginStatus::NOT_LOGGED_IN && |
| - !Shell::Get()->session_controller()->IsInSecondaryLoginScreen(); |
| -} |
| - |
| // Methods for testing |
| bool WebNotificationTray::IsPopupVisible() const { |