blob: c7943214f81f6edd1fdb745713f24c7b1cfd5a4b (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
// Copyright (c) 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/session_state_delegate_stub.h"
#include "ash/shell.h"
#include "ash/shell/example_factory.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
namespace ash {
SessionStateDelegateStub::SessionStateDelegateStub() : screen_locked_(false) {
}
SessionStateDelegateStub::~SessionStateDelegateStub() {
}
int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const {
return 3;
}
int SessionStateDelegateStub::NumberOfLoggedInUsers() const {
return 1;
}
bool SessionStateDelegateStub::IsActiveUserSessionStarted() const {
return true;
}
bool SessionStateDelegateStub::CanLockScreen() const {
return true;
}
bool SessionStateDelegateStub::IsScreenLocked() const {
return screen_locked_;
}
bool SessionStateDelegateStub::ShouldLockScreenBeforeSuspending() const {
return false;
}
void SessionStateDelegateStub::LockScreen() {
shell::CreateLockScreen();
screen_locked_ = true;
Shell::GetInstance()->UpdateShelfVisibility();
}
void SessionStateDelegateStub::UnlockScreen() {
screen_locked_ = false;
Shell::GetInstance()->UpdateShelfVisibility();
}
bool SessionStateDelegateStub::IsUserSessionBlocked() const {
return !IsActiveUserSessionStarted() || IsScreenLocked();
}
const base::string16 SessionStateDelegateStub::GetUserDisplayName(
MultiProfileIndex index) const {
return UTF8ToUTF16("stub-user");
}
const std::string SessionStateDelegateStub::GetUserEmail(
MultiProfileIndex index) const {
return "stub-user@domain.com";
}
const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage(
MultiProfileIndex index) const {
return null_image_;
}
void SessionStateDelegateStub::GetLoggedInUsers(UserIdList* users) {
}
void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) {
}
void SessionStateDelegateStub::SwitchActiveUserToNext() {
}
void SessionStateDelegateStub::AddSessionStateObserver(
ash::SessionStateObserver* observer) {
}
void SessionStateDelegateStub::RemoveSessionStateObserver(
ash::SessionStateObserver* observer) {
}
} // namespace ash
|