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 "ash/session_state_delegate.h" | 8 #include <vector> |
| 9 |
| 10 #include "ash/session/session_state_delegate.h" |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
12 | 14 |
13 namespace ash { | 15 namespace ash { |
14 namespace test { | 16 namespace test { |
15 | 17 |
| 18 class MockUserInfo; |
| 19 |
16 class TestSessionStateDelegate : public SessionStateDelegate { | 20 class TestSessionStateDelegate : public SessionStateDelegate { |
17 public: | 21 public: |
18 TestSessionStateDelegate(); | 22 TestSessionStateDelegate(); |
19 virtual ~TestSessionStateDelegate(); | 23 virtual ~TestSessionStateDelegate(); |
20 | 24 |
21 void set_logged_in_users(int users) { logged_in_users_ = users; } | 25 void set_logged_in_users(int users) { logged_in_users_ = users; } |
22 const std::string& get_activated_user() { return activated_user_; } | 26 void AddUser(const std::string user_id); |
| 27 const UserInfo* GetActiveUserInfo() const; |
23 | 28 |
24 // SessionStateDelegate: | 29 // SessionStateDelegate: |
25 virtual content::BrowserContext* GetBrowserContextByIndex( | 30 virtual content::BrowserContext* GetBrowserContextByIndex( |
26 MultiProfileIndex index) OVERRIDE; | 31 MultiProfileIndex index) OVERRIDE; |
27 virtual content::BrowserContext* GetBrowserContextForWindow( | 32 virtual content::BrowserContext* GetBrowserContextForWindow( |
28 aura::Window* window) OVERRIDE; | 33 aura::Window* window) OVERRIDE; |
29 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; | 34 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE; |
30 virtual int NumberOfLoggedInUsers() const OVERRIDE; | 35 virtual int NumberOfLoggedInUsers() const OVERRIDE; |
31 virtual bool IsActiveUserSessionStarted() const OVERRIDE; | 36 virtual bool IsActiveUserSessionStarted() const OVERRIDE; |
32 virtual bool CanLockScreen() const OVERRIDE; | 37 virtual bool CanLockScreen() const OVERRIDE; |
33 virtual bool IsScreenLocked() const OVERRIDE; | 38 virtual bool IsScreenLocked() const OVERRIDE; |
34 virtual bool ShouldLockScreenBeforeSuspending() const OVERRIDE; | 39 virtual bool ShouldLockScreenBeforeSuspending() const OVERRIDE; |
35 virtual void LockScreen() OVERRIDE; | 40 virtual void LockScreen() OVERRIDE; |
36 virtual void UnlockScreen() OVERRIDE; | 41 virtual void UnlockScreen() OVERRIDE; |
37 virtual bool IsUserSessionBlocked() const OVERRIDE; | 42 virtual bool IsUserSessionBlocked() const OVERRIDE; |
38 virtual SessionState GetSessionState() const OVERRIDE; | 43 virtual SessionState GetSessionState() const OVERRIDE; |
39 virtual const base::string16 GetUserDisplayName( | 44 virtual const UserInfo* GetUserInfo( |
40 ash::MultiProfileIndex index) const OVERRIDE; | 45 ash::MultiProfileIndex index) const OVERRIDE; |
41 virtual const base::string16 GetUserGivenName( | 46 virtual const UserInfo* GetUserInfo( |
42 ash::MultiProfileIndex index) const OVERRIDE; | |
43 virtual const std::string GetUserEmail( | |
44 ash::MultiProfileIndex index) const OVERRIDE; | |
45 virtual const std::string GetUserID( | |
46 ash::MultiProfileIndex index) const OVERRIDE; | |
47 virtual const gfx::ImageSkia& GetUserImage( | |
48 content::BrowserContext* context) const OVERRIDE; | 47 content::BrowserContext* context) const OVERRIDE; |
49 virtual bool ShouldShowAvatar(aura::Window* window) OVERRIDE; | 48 virtual bool ShouldShowAvatar(aura::Window* window) const OVERRIDE; |
50 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 49 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; |
51 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; | 50 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; |
52 virtual void AddSessionStateObserver( | 51 virtual void AddSessionStateObserver( |
53 ash::SessionStateObserver* observer) OVERRIDE; | 52 ash::SessionStateObserver* observer) OVERRIDE; |
54 virtual void RemoveSessionStateObserver( | 53 virtual void RemoveSessionStateObserver( |
55 ash::SessionStateObserver* observer) OVERRIDE; | 54 ash::SessionStateObserver* observer) OVERRIDE; |
56 | 55 |
57 // TODO(oshima): Use state machine instead of using boolean variables. | 56 // TODO(oshima): Use state machine instead of using boolean variables. |
58 | 57 |
59 // 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 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 100 |
102 // Whether the screen is currently locked. | 101 // Whether the screen is currently locked. |
103 bool screen_locked_; | 102 bool screen_locked_; |
104 | 103 |
105 // Whether user addding screen is running now. | 104 // Whether user addding screen is running now. |
106 bool user_adding_screen_running_; | 105 bool user_adding_screen_running_; |
107 | 106 |
108 // The number of users logged in. | 107 // The number of users logged in. |
109 int logged_in_users_; | 108 int logged_in_users_; |
110 | 109 |
111 // The activated user. | 110 // The index for the activated user. |
112 std::string activated_user_; | 111 int active_user_index_; |
113 | 112 |
114 // A test user image. | 113 std::vector<MockUserInfo*> user_list_; |
115 gfx::ImageSkia user_image_; | |
116 | 114 |
117 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); | 115 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); |
118 }; | 116 }; |
119 | 117 |
120 } // namespace test | 118 } // namespace test |
121 } // namespace ash | 119 } // namespace ash |
122 | 120 |
123 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 121 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
OLD | NEW |