OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 5 #ifndef ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
6 #define ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
15 | 15 |
| 16 class AccountId; |
| 17 |
16 namespace ash { | 18 namespace ash { |
17 namespace test { | 19 namespace test { |
18 | 20 |
19 class MockUserInfo; | 21 class MockUserInfo; |
20 | 22 |
21 class TestSessionStateDelegate : public SessionStateDelegate { | 23 class TestSessionStateDelegate : public SessionStateDelegate { |
22 public: | 24 public: |
23 TestSessionStateDelegate(); | 25 TestSessionStateDelegate(); |
24 ~TestSessionStateDelegate() override; | 26 ~TestSessionStateDelegate() override; |
25 | 27 |
26 void set_logged_in_users(int users) { logged_in_users_ = users; } | 28 void set_logged_in_users(int users) { logged_in_users_ = users; } |
27 void set_session_state(SessionState session_state) { | 29 void set_session_state(SessionState session_state) { |
28 session_state_ = session_state; | 30 session_state_ = session_state; |
29 } | 31 } |
30 void AddUser(const std::string& user_id); | 32 void AddUser(const AccountId& account_id); |
31 const user_manager::UserInfo* GetActiveUserInfo() const; | 33 const user_manager::UserInfo* GetActiveUserInfo() const; |
32 | 34 |
33 // SessionStateDelegate: | 35 // SessionStateDelegate: |
34 int GetMaximumNumberOfLoggedInUsers() const override; | 36 int GetMaximumNumberOfLoggedInUsers() const override; |
35 int NumberOfLoggedInUsers() const override; | 37 int NumberOfLoggedInUsers() const override; |
36 bool IsActiveUserSessionStarted() const override; | 38 bool IsActiveUserSessionStarted() const override; |
37 bool CanLockScreen() const override; | 39 bool CanLockScreen() const override; |
38 bool IsScreenLocked() const override; | 40 bool IsScreenLocked() const override; |
39 bool ShouldLockScreenBeforeSuspending() const override; | 41 bool ShouldLockScreenBeforeSuspending() const override; |
40 void LockScreen() override; | 42 void LockScreen() override; |
41 void UnlockScreen() override; | 43 void UnlockScreen() override; |
42 bool IsUserSessionBlocked() const override; | 44 bool IsUserSessionBlocked() const override; |
43 SessionState GetSessionState() const override; | 45 SessionState GetSessionState() const override; |
44 const user_manager::UserInfo* GetUserInfo( | 46 const user_manager::UserInfo* GetUserInfo( |
45 ash::UserIndex index) const override; | 47 ash::UserIndex index) const override; |
46 bool ShouldShowAvatar(aura::Window* window) const override; | 48 bool ShouldShowAvatar(aura::Window* window) const override; |
47 gfx::ImageSkia GetAvatarImageForWindow(aura::Window* window) const override; | 49 gfx::ImageSkia GetAvatarImageForWindow(aura::Window* window) const override; |
48 void SwitchActiveUser(const std::string& user_id) override; | 50 void SwitchActiveUser(const AccountId& account_id) override; |
49 void CycleActiveUser(CycleUser cycle_user) override; | 51 void CycleActiveUser(CycleUser cycle_user) override; |
50 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override; | 52 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override; |
51 void AddSessionStateObserver(ash::SessionStateObserver* observer) override; | 53 void AddSessionStateObserver(ash::SessionStateObserver* observer) override; |
52 void RemoveSessionStateObserver(ash::SessionStateObserver* observer) override; | 54 void RemoveSessionStateObserver(ash::SessionStateObserver* observer) override; |
53 | 55 |
54 // TODO(oshima): Use state machine instead of using boolean variables. | 56 // TODO(oshima): Use state machine instead of using boolean variables. |
55 | 57 |
56 // Updates the internal state that indicates whether a session is in progress | 58 // Updates the internal state that indicates whether a session is in progress |
57 // and there is an active user. If |has_active_user| is |false|, | 59 // and there is an active user. If |has_active_user| is |false|, |
58 // |active_user_session_started_| is reset to |false| as well (see below for | 60 // |active_user_session_started_| is reset to |false| as well (see below for |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // before the profile and browser UI are available. | 113 // before the profile and browser UI are available. |
112 SessionState session_state_; | 114 SessionState session_state_; |
113 | 115 |
114 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); |
115 }; | 117 }; |
116 | 118 |
117 } // namespace test | 119 } // namespace test |
118 } // namespace ash | 120 } // namespace ash |
119 | 121 |
120 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 122 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
OLD | NEW |