OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 message_center_tray_->HideMessageCenterBubble(); | 510 message_center_tray_->HideMessageCenterBubble(); |
511 } | 511 } |
512 | 512 |
513 message_center::MessageCenter* WebNotificationTray::message_center() const { | 513 message_center::MessageCenter* WebNotificationTray::message_center() const { |
514 return message_center_tray_->message_center(); | 514 return message_center_tray_->message_center(); |
515 } | 515 } |
516 | 516 |
517 bool WebNotificationTray::IsLoggedIn() const { | 517 bool WebNotificationTray::IsLoggedIn() const { |
518 WmShell* shell = WmShell::Get(); | 518 WmShell* shell = WmShell::Get(); |
519 LoginStatus status = shell->system_tray_delegate()->GetUserLoginStatus(); | 519 return shell->system_tray_delegate()->GetUserLoginStatus() != |
520 return status != LoginStatus::NOT_LOGGED_IN && | 520 LoginStatus::NOT_LOGGED_IN && |
521 status != LoginStatus::LOCKED && | |
522 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
523 } | 522 } |
524 | 523 |
525 // Methods for testing | 524 // Methods for testing |
526 | 525 |
527 bool WebNotificationTray::IsPopupVisible() const { | 526 bool WebNotificationTray::IsPopupVisible() const { |
528 return message_center_tray_->popups_visible(); | 527 return message_center_tray_->popups_visible(); |
529 } | 528 } |
530 | 529 |
531 message_center::MessageCenterBubble* | 530 message_center::MessageCenterBubble* |
532 WebNotificationTray::GetMessageCenterBubbleForTest() { | 531 WebNotificationTray::GetMessageCenterBubbleForTest() { |
533 if (!message_center_bubble()) | 532 if (!message_center_bubble()) |
534 return NULL; | 533 return NULL; |
535 return static_cast<message_center::MessageCenterBubble*>( | 534 return static_cast<message_center::MessageCenterBubble*>( |
536 message_center_bubble()->bubble()); | 535 message_center_bubble()->bubble()); |
537 } | 536 } |
538 | 537 |
539 } // namespace ash | 538 } // namespace ash |
OLD | NEW |