diff options
Diffstat (limited to 'ash/system/user/config.cc')
-rw-r--r-- | ash/system/user/config.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ash/system/user/config.cc b/ash/system/user/config.cc new file mode 100644 index 0000000..d704393 --- /dev/null +++ b/ash/system/user/config.cc @@ -0,0 +1,36 @@ +// Copyright 2014 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/config.h" + +#include "ash/session_state_delegate.h" +#include "ash/shell.h" +#include "ash/shell_delegate.h" + +namespace ash { +namespace tray { + +namespace { + +// Returns true if session is blocked by e.g. the login screen. +bool IsUserSessionBlocked() { + return Shell::GetInstance() + ->session_state_delegate() + ->IsUserSessionBlocked(); +} + +} // namespace + +bool IsMultiProfileSupportedAndUserActive() { + return Shell::GetInstance()->delegate()->IsMultiProfilesEnabled() && + !IsUserSessionBlocked(); +} + +bool IsMultiAccountSupportedAndUserActive() { + return Shell::GetInstance()->delegate()->IsMultiAccountEnabled() && + !IsUserSessionBlocked(); +} + +} // namespace tray +} // namespace ash |