| 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 "ash/session_state_delegate.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ash::MultiProfileIndex index) const OVERRIDE; | 39 ash::MultiProfileIndex index) const OVERRIDE; |
| 40 virtual const gfx::ImageSkia& GetUserImage( | 40 virtual const gfx::ImageSkia& GetUserImage( |
| 41 ash::MultiProfileIndex index) const OVERRIDE; | 41 ash::MultiProfileIndex index) const OVERRIDE; |
| 42 virtual void GetLoggedInUsers(UserIdList* users) OVERRIDE; | 42 virtual void GetLoggedInUsers(UserIdList* users) OVERRIDE; |
| 43 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 43 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; |
| 44 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; | 44 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE; |
| 45 virtual void AddSessionStateObserver( | 45 virtual void AddSessionStateObserver( |
| 46 ash::SessionStateObserver* observer) OVERRIDE; | 46 ash::SessionStateObserver* observer) OVERRIDE; |
| 47 virtual void RemoveSessionStateObserver( | 47 virtual void RemoveSessionStateObserver( |
| 48 ash::SessionStateObserver* observer) OVERRIDE; | 48 ash::SessionStateObserver* observer) OVERRIDE; |
| 49 virtual bool TransferWindowToDesktopOfUser( | |
| 50 aura::Window* window, | |
| 51 ash::MultiProfileIndex index) OVERRIDE; | |
| 52 | 49 |
| 53 // TODO(oshima): Use state machine instead of using boolean variables. | 50 // TODO(oshima): Use state machine instead of using boolean variables. |
| 54 | 51 |
| 55 // Updates the internal state that indicates whether a session is in progress | 52 // Updates the internal state that indicates whether a session is in progress |
| 56 // and there is an active user. If |has_active_user| is |false|, | 53 // and there is an active user. If |has_active_user| is |false|, |
| 57 // |active_user_session_started_| is reset to |false| as well (see below for | 54 // |active_user_session_started_| is reset to |false| as well (see below for |
| 58 // the difference between these two flags). | 55 // the difference between these two flags). |
| 59 void SetHasActiveUser(bool has_active_user); | 56 void SetHasActiveUser(bool has_active_user); |
| 60 | 57 |
| 61 // Updates the internal state that indicates whether the session has been | 58 // Updates the internal state that indicates whether the session has been |
| 62 // fully started for the active user. If |active_user_session_started| is | 59 // fully started for the active user. If |active_user_session_started| is |
| 63 // |true|, |has_active_user_| is set to |true| as well (see below for the | 60 // |true|, |has_active_user_| is set to |true| as well (see below for the |
| 64 // difference between these two flags). | 61 // difference between these two flags). |
| 65 void SetActiveUserSessionStarted(bool active_user_session_started); | 62 void SetActiveUserSessionStarted(bool active_user_session_started); |
| 66 | 63 |
| 67 // Updates the internal state that indicates whether the screen can be locked. | 64 // Updates the internal state that indicates whether the screen can be locked. |
| 68 // Locking will only actually be allowed when this value is |true| and there | 65 // Locking will only actually be allowed when this value is |true| and there |
| 69 // is an active user. | 66 // is an active user. |
| 70 void SetCanLockScreen(bool can_lock_screen); | 67 void SetCanLockScreen(bool can_lock_screen); |
| 71 | 68 |
| 72 // Updates |should_lock_screen_before_suspending_|. | 69 // Updates |should_lock_screen_before_suspending_|. |
| 73 void SetShouldLockScreenBeforeSuspending(bool should_lock); | 70 void SetShouldLockScreenBeforeSuspending(bool should_lock); |
| 74 | 71 |
| 75 // Updates the internal state that indicates whether user adding screen is | 72 // Updates the internal state that indicates whether user adding screen is |
| 76 // running now. | 73 // running now. |
| 77 void SetUserAddingScreenRunning(bool user_adding_screen_running); | 74 void SetUserAddingScreenRunning(bool user_adding_screen_running); |
| 78 | 75 |
| 79 // Returns the number of calls to TransferWindowToDesktopOfUser. | |
| 80 int num_transfer_to_desktop_of_user_calls() { | |
| 81 return num_transfer_to_desktop_of_user_calls_; | |
| 82 } | |
| 83 | |
| 84 private: | 76 private: |
| 85 // Whether a session is in progress and there is an active user. | 77 // Whether a session is in progress and there is an active user. |
| 86 bool has_active_user_; | 78 bool has_active_user_; |
| 87 | 79 |
| 88 // When a user becomes active, the profile and browser UI are not immediately | 80 // When a user becomes active, the profile and browser UI are not immediately |
| 89 // available. Only once this flag becomes |true| is the browser startup | 81 // available. Only once this flag becomes |true| is the browser startup |
| 90 // complete and both profile and UI are fully available. | 82 // complete and both profile and UI are fully available. |
| 91 bool active_user_session_started_; | 83 bool active_user_session_started_; |
| 92 | 84 |
| 93 // Whether the screen can be locked. Locking will only actually be allowed | 85 // Whether the screen can be locked. Locking will only actually be allowed |
| (...skipping 11 matching lines...) Expand all Loading... |
| 105 | 97 |
| 106 // The number of users logged in. | 98 // The number of users logged in. |
| 107 int logged_in_users_; | 99 int logged_in_users_; |
| 108 | 100 |
| 109 // The activated user. | 101 // The activated user. |
| 110 std::string activated_user_; | 102 std::string activated_user_; |
| 111 | 103 |
| 112 // A test user image. | 104 // A test user image. |
| 113 gfx::ImageSkia null_image_; | 105 gfx::ImageSkia null_image_; |
| 114 | 106 |
| 115 // The number of calls which happened to TransferWindowToDesktopOfUser. | |
| 116 int num_transfer_to_desktop_of_user_calls_; | |
| 117 | |
| 118 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(TestSessionStateDelegate); |
| 119 }; | 108 }; |
| 120 | 109 |
| 121 } // namespace test | 110 } // namespace test |
| 122 } // namespace ash | 111 } // namespace ash |
| 123 | 112 |
| 124 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ | 113 #endif // ASH_TEST_TEST_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |