summaryrefslogtreecommitdiff
path: root/chromium/ash/system/user/tray_user_separator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ash/system/user/tray_user_separator.cc')
-rw-r--r--chromium/ash/system/user/tray_user_separator.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/chromium/ash/system/user/tray_user_separator.cc b/chromium/ash/system/user/tray_user_separator.cc
new file mode 100644
index 00000000000..dc63bff9f4d
--- /dev/null
+++ b/chromium/ash/system/user/tray_user_separator.cc
@@ -0,0 +1,48 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/system/user/tray_user_separator.h"
+
+#include "ash/session_state_delegate.h"
+#include "ash/shell.h"
+#include "ui/views/view.h"
+
+namespace ash {
+namespace internal {
+
+TrayUserSeparator::TrayUserSeparator(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ separator_shown_(false) {
+}
+
+views::View* TrayUserSeparator::CreateTrayView(user::LoginStatus status) {
+ return NULL;
+}
+
+views::View* TrayUserSeparator::CreateDefaultView(user::LoginStatus status) {
+ if (status == user::LOGGED_IN_NONE)
+ return NULL;
+
+ const SessionStateDelegate* session_state_delegate =
+ Shell::GetInstance()->session_state_delegate();
+
+ // If the screen is locked, or only a single user is shown, show nothing.
+ if (session_state_delegate->IsUserSessionBlocked() ||
+ session_state_delegate->NumberOfLoggedInUsers() < 2)
+ return NULL;
+
+ separator_shown_ = true;
+ return new views::View();
+}
+
+views::View* TrayUserSeparator::CreateDetailedView(user::LoginStatus status) {
+ return NULL;
+}
+
+void TrayUserSeparator::DestroyDefaultView() {
+ separator_shown_ = false;
+}
+
+} // namespace internal
+} // namespace ash