1// Copyright (c) 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/session_state_delegate_stub.h"
6
7#include "ash/shell.h"
8#include "ash/shell/example_factory.h"
9#include "base/strings/string16.h"
10#include "base/strings/utf_string_conversions.h"
11
12namespace ash {
13
14SessionStateDelegateStub::SessionStateDelegateStub() : screen_locked_(false) {
15}
16
17SessionStateDelegateStub::~SessionStateDelegateStub() {
18}
19
20int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const {
21  return 3;
22}
23
24int SessionStateDelegateStub::NumberOfLoggedInUsers() const {
25  return 1;
26}
27
28bool SessionStateDelegateStub::IsActiveUserSessionStarted() const {
29  return true;
30}
31
32bool SessionStateDelegateStub::CanLockScreen() const {
33  return true;
34}
35
36bool SessionStateDelegateStub::IsScreenLocked() const {
37  return screen_locked_;
38}
39
40void SessionStateDelegateStub::LockScreen() {
41  shell::CreateLockScreen();
42  screen_locked_ = true;
43  Shell::GetInstance()->UpdateShelfVisibility();
44}
45
46void SessionStateDelegateStub::UnlockScreen() {
47  screen_locked_ = false;
48  Shell::GetInstance()->UpdateShelfVisibility();
49}
50
51bool SessionStateDelegateStub::IsUserSessionBlocked() const  {
52  return !IsActiveUserSessionStarted() || IsScreenLocked();
53}
54
55const base::string16 SessionStateDelegateStub::GetUserDisplayName(
56    MultiProfileIndex index) const {
57  return UTF8ToUTF16("stub-user");
58}
59
60const std::string SessionStateDelegateStub::GetUserEmail(
61    MultiProfileIndex index) const {
62  return "stub-user@domain.com";
63}
64
65const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage(
66    MultiProfileIndex index) const {
67  return null_image_;
68}
69
70void SessionStateDelegateStub::GetLoggedInUsers(UserIdList* users) {
71}
72
73void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) {
74}
75
76void SessionStateDelegateStub::AddSessionStateObserver(
77    ash::SessionStateObserver* observer) {
78}
79
80void SessionStateDelegateStub::RemoveSessionStateObserver(
81    ash::SessionStateObserver* observer) {
82}
83
84}  // namespace ash
85