| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 | 508 |
| 509 message_center_tray_->HideMessageCenterBubble(); | 509 message_center_tray_->HideMessageCenterBubble(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 message_center::MessageCenter* WebNotificationTray::message_center() const { | 512 message_center::MessageCenter* WebNotificationTray::message_center() const { |
| 513 return message_center_tray_->message_center(); | 513 return message_center_tray_->message_center(); |
| 514 } | 514 } |
| 515 | 515 |
| 516 bool WebNotificationTray::IsLoggedIn() const { | 516 bool WebNotificationTray::IsLoggedIn() const { |
| 517 WmShell* shell = WmShell::Get(); | 517 WmShell* shell = WmShell::Get(); |
| 518 // TODO(jamescook): Should this also check LoginState::LOCKED? | 518 LoginStatus status = shell->system_tray_delegate()->GetUserLoginStatus(); |
| 519 return shell->system_tray_delegate()->GetUserLoginStatus() != | 519 return status != LoginStatus::NOT_LOGGED_IN && |
| 520 LoginStatus::NOT_LOGGED_IN && | 520 status != LoginStatus::LOCKED && |
| 521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 522 } | 522 } |
| 523 | 523 |
| 524 // Methods for testing | 524 // Methods for testing |
| 525 | 525 |
| 526 bool WebNotificationTray::IsPopupVisible() const { | 526 bool WebNotificationTray::IsPopupVisible() const { |
| 527 return message_center_tray_->popups_visible(); | 527 return message_center_tray_->popups_visible(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 message_center::MessageCenterBubble* | 530 message_center::MessageCenterBubble* |
| 531 WebNotificationTray::GetMessageCenterBubbleForTest() { | 531 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 532 if (!message_center_bubble()) | 532 if (!message_center_bubble()) |
| 533 return NULL; | 533 return NULL; |
| 534 return static_cast<message_center::MessageCenterBubble*>( | 534 return static_cast<message_center::MessageCenterBubble*>( |
| 535 message_center_bubble()->bubble()); | 535 message_center_bubble()->bubble()); |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace ash | 538 } // namespace ash |
| OLD | NEW |