| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CONTROLLER_CLIENT_H_ | 5 #ifndef ASH_TEST_TEST_SESSION_CONTROLLER_CLIENT_H_ |
| 6 #define ASH_TEST_TEST_SESSION_CONTROLLER_CLIENT_H_ | 6 #define ASH_TEST_TEST_SESSION_CONTROLLER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void SetCanLockScreen(bool can_lock); | 43 void SetCanLockScreen(bool can_lock); |
| 44 void SetShouldLockScreenAutomatically(bool should_lock); | 44 void SetShouldLockScreenAutomatically(bool should_lock); |
| 45 void SetSessionState(session_manager::SessionState state); | 45 void SetSessionState(session_manager::SessionState state); |
| 46 | 46 |
| 47 // Creates the |count| pre-defined user sessions. The users are named by | 47 // Creates the |count| pre-defined user sessions. The users are named by |
| 48 // numbers using "user%d@tray" template. Note that existing user sessions | 48 // numbers using "user%d@tray" template. Note that existing user sessions |
| 49 // prior this call will be removed without sending out notifications. | 49 // prior this call will be removed without sending out notifications. |
| 50 void CreatePredefinedUserSessions(int count); | 50 void CreatePredefinedUserSessions(int count); |
| 51 | 51 |
| 52 // Adds a user session from a given display email. The display email will be | 52 // Adds a user session from a given display email. The display email will be |
| 53 // canonicalized and used to construct an AccountId. | 53 // canonicalized and used to construct an AccountId. |enable_settings| sets |
| 54 void AddUserSession(const std::string& display_email); | 54 // whether web UI settings are allowed. |
| 55 void AddUserSession(const std::string& display_email, |
| 56 bool enable_settings = true); |
| 55 | 57 |
| 56 // Simulates screen unlocking. It is virtual so that test cases can override | 58 // Simulates screen unlocking. It is virtual so that test cases can override |
| 57 // it. The default implementation sets the session state of SessionController | 59 // it. The default implementation sets the session state of SessionController |
| 58 // to be ACTIVE. | 60 // to be ACTIVE. |
| 59 virtual void UnlockScreen(); | 61 virtual void UnlockScreen(); |
| 60 | 62 |
| 61 // ash::mojom::SessionControllerClient: | 63 // ash::mojom::SessionControllerClient: |
| 62 void RequestLockScreen() override; | 64 void RequestLockScreen() override; |
| 63 void SwitchActiveUser(const AccountId& account_id) override; | 65 void SwitchActiveUser(const AccountId& account_id) override; |
| 64 void CycleActiveUser(CycleUserDirection direction) override; | 66 void CycleActiveUser(CycleUserDirection direction) override; |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 SessionController* const controller_; | 69 SessionController* const controller_; |
| 68 | 70 |
| 69 // Binds to the client interface. | 71 // Binds to the client interface. |
| 70 mojo::Binding<ash::mojom::SessionControllerClient> binding_; | 72 mojo::Binding<ash::mojom::SessionControllerClient> binding_; |
| 71 | 73 |
| 72 int fake_session_id_ = 0; | 74 int fake_session_id_ = 0; |
| 73 mojom::SessionInfoPtr session_info_; | 75 mojom::SessionInfoPtr session_info_; |
| 74 | 76 |
| 75 DISALLOW_COPY_AND_ASSIGN(TestSessionControllerClient); | 77 DISALLOW_COPY_AND_ASSIGN(TestSessionControllerClient); |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace test | 80 } // namespace test |
| 79 } // namespace ash | 81 } // namespace ash |
| 80 | 82 |
| 81 #endif // ASH_TEST_TEST_SESSION_CONTROLLER_CLIENT_H_ | 83 #endif // ASH_TEST_TEST_SESSION_CONTROLLER_CLIENT_H_ |
| OLD | NEW |