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