Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: ash/system/web_notification/web_notification_tray.cc

Issue 2822033002: cros: Use SessionController to enable system tray settings / notifications tray (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | ash/test/test_session_controller_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | ash/test/test_session_controller_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698