| 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_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 5 #ifndef ASH_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
| 6 #define ASH_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/common/session/session_state_delegate.h" | 11 #include "ash/common/session/session_state_delegate.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
| 15 | 15 |
| 16 class AccountId; | 16 class AccountId; |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace test { | 19 namespace test { |
| 20 | 20 |
| 21 class MockUserInfo; | 21 class MockUserInfo; |
| 22 | 22 |
| 23 class TestSessionStateDelegate : public SessionStateDelegate { | 23 class TestSessionStateDelegate : public SessionStateDelegate { |
| 24 public: | 24 public: |
| 25 TestSessionStateDelegate(); | 25 TestSessionStateDelegate(); |
| 26 ~TestSessionStateDelegate() override; | 26 ~TestSessionStateDelegate() override; |
| 27 | 27 |
| 28 void set_logged_in_users(int users) { logged_in_users_ = users; } | 28 void set_logged_in_users(int users) { logged_in_users_ = users; } |
| 29 void set_session_state(SessionState session_state) { | 29 void set_session_state(session_manager::SessionState session_state) { |
| 30 session_state_ = session_state; | 30 session_state_ = session_state; |
| 31 } | 31 } |
| 32 void AddUser(const AccountId& account_id); | 32 void AddUser(const AccountId& account_id); |
| 33 const user_manager::UserInfo* GetActiveUserInfo() const; | 33 const user_manager::UserInfo* GetActiveUserInfo() const; |
| 34 | 34 |
| 35 // SessionStateDelegate: | 35 // SessionStateDelegate: |
| 36 int GetMaximumNumberOfLoggedInUsers() const override; | 36 int GetMaximumNumberOfLoggedInUsers() const override; |
| 37 int NumberOfLoggedInUsers() const override; | 37 int NumberOfLoggedInUsers() const override; |
| 38 bool IsActiveUserSessionStarted() const override; | 38 bool IsActiveUserSessionStarted() const override; |
| 39 bool CanLockScreen() const override; | 39 bool CanLockScreen() const override; |
| 40 bool IsScreenLocked() const override; | 40 bool IsScreenLocked() const override; |
| 41 bool ShouldLockScreenBeforeSuspending() const override; | 41 bool ShouldLockScreenBeforeSuspending() const override; |
| 42 void LockScreen() override; | 42 void LockScreen() override; |
| 43 void UnlockScreen() override; | 43 void UnlockScreen() override; |
| 44 bool IsUserSessionBlocked() const override; | 44 bool IsUserSessionBlocked() const override; |
| 45 SessionState GetSessionState() const override; | 45 session_manager::SessionState GetSessionState() const override; |
| 46 const user_manager::UserInfo* GetUserInfo( | 46 const user_manager::UserInfo* GetUserInfo( |
| 47 ash::UserIndex index) const override; | 47 ash::UserIndex index) const override; |
| 48 bool ShouldShowAvatar(WmWindow* window) const override; | 48 bool ShouldShowAvatar(WmWindow* window) const override; |
| 49 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override; | 49 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override; |
| 50 void SwitchActiveUser(const AccountId& account_id) override; | 50 void SwitchActiveUser(const AccountId& account_id) override; |
| 51 void CycleActiveUser(CycleUser cycle_user) override; | 51 void CycleActiveUser(CycleUser cycle_user) override; |
| 52 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override; | 52 bool IsMultiProfileAllowedByPrimaryUserPolicy() const override; |
| 53 void AddSessionStateObserver(ash::SessionStateObserver* observer) override; | 53 void AddSessionStateObserver(ash::SessionStateObserver* observer) override; |
| 54 void RemoveSessionStateObserver(ash::SessionStateObserver* observer) override; | 54 void RemoveSessionStateObserver(ash::SessionStateObserver* observer) override; |
| 55 | 55 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // The index for the activated user. | 104 // The index for the activated user. |
| 105 int active_user_index_; | 105 int active_user_index_; |
| 106 | 106 |
| 107 std::vector<std::unique_ptr<MockUserInfo>> user_list_; | 107 std::vector<std::unique_ptr<MockUserInfo>> user_list_; |
| 108 | 108 |
| 109 // The user manager to be used instead of the system instance. | 109 // The user manager to be used instead of the system instance. |
| 110 std::unique_ptr<TestUserManager> user_manager_; | 110 std::unique_ptr<TestUserManager> user_manager_; |
| 111 | 111 |
| 112 // The current state of the login screen. |session_state_| becomes active | 112 // The current state of the login screen. |session_state_| becomes active |
| 113 // before the profile and browser UI are available. | 113 // before the profile and browser UI are available. |
| 114 SessionState session_state_; | 114 session_manager::SessionState session_state_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace test | 119 } // namespace test |
| 120 } // namespace ash | 120 } // namespace ash |
| 121 | 121 |
| 122 #endif // ASH_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 122 #endif // ASH_COMMON_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |