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