| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/common/system/user/tray_user_separator.h" | |
| 6 | |
| 7 #include "ash/common/session/session_state_delegate.h" | |
| 8 #include "ash/common/wm_shell.h" | |
| 9 #include "ui/views/view.h" | |
| 10 | |
| 11 namespace ash { | |
| 12 | |
| 13 TrayUserSeparator::TrayUserSeparator(SystemTray* system_tray) | |
| 14 : SystemTrayItem(system_tray, UMA_NOT_RECORDED), separator_shown_(false) {} | |
| 15 | |
| 16 views::View* TrayUserSeparator::CreateDefaultView(LoginStatus status) { | |
| 17 if (status == LoginStatus::NOT_LOGGED_IN) | |
| 18 return NULL; | |
| 19 | |
| 20 const SessionStateDelegate* session_state_delegate = | |
| 21 WmShell::Get()->GetSessionStateDelegate(); | |
| 22 | |
| 23 // If the screen is locked, a system modal dialog or a single user is shown, | |
| 24 // show nothing. | |
| 25 if (session_state_delegate->IsUserSessionBlocked() || | |
| 26 WmShell::Get()->IsSystemModalWindowOpen() || | |
| 27 session_state_delegate->NumberOfLoggedInUsers() < 2) | |
| 28 return NULL; | |
| 29 | |
| 30 separator_shown_ = true; | |
| 31 return new views::View(); | |
| 32 } | |
| 33 | |
| 34 void TrayUserSeparator::DestroyDefaultView() { | |
| 35 separator_shown_ = false; | |
| 36 } | |
| 37 | |
| 38 } // namespace ash | |
| OLD | NEW |