summaryrefslogtreecommitdiffstats
path: root/ash/system/user/config.cc
blob: d704393e328d9f7c3cc57c85dad859ac9ace4c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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