Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module ash.mojom; | |
| 6 | |
| 7 import "skia/public/interfaces/bitmap.mojom"; | |
| 8 | |
| 9 // Matches session_manager::SessionState | |
|
James Cook
2016/12/01 23:01:43
super nit: end with . (and below) for consistency
xiyuan
2016/12/06 00:46:34
Done.
| |
| 10 [Extensible] | |
| 11 enum SessionState { | |
| 12 UNKNOWN, | |
|
James Cook
2016/12/01 23:01:43
nit: Please copy the comments for these enum value
xiyuan
2016/12/06 00:46:34
Done.
| |
| 13 OOBE, | |
| 14 LOGIN_PRIMARY, | |
| 15 LOGGED_IN_NOT_ACTIVE, | |
| 16 ACTIVE, | |
| 17 LOCKED, | |
| 18 LOGIN_SECONDARY, | |
| 19 }; | |
| 20 | |
| 21 // Matches user_manager::UserType. | |
| 22 [Extensible] | |
| 23 enum UserType { | |
| 24 REGULAR, | |
| 25 GUEST, | |
| 26 PUBLIC_ACCOUNT, | |
| 27 SUPERVISED, | |
| 28 KIOSK, | |
| 29 CHILD, | |
| 30 ARC_KIOSK, | |
| 31 }; | |
| 32 | |
| 33 // Info about a user session in ash. | |
| 34 struct UserSession { | |
| 35 UserType type; | |
| 36 string account_id; // Serialized AccountId | |
| 37 string display_name; | |
| 38 string display_email; | |
| 39 skia.mojom.Bitmap avatar; | |
| 40 }; | |
| 41 | |
| 42 // Matches ash::AddUserSessionPolicy | |
| 43 [Extensible] | |
| 44 enum AddUserSessionPolicy { | |
| 45 ALLOWED, | |
| 46 ERROR_NOT_ALLOWED_PRIMARY_USER, | |
| 47 ERROR_NO_ELIGIBLE_USERS, | |
| 48 ERROR_MAXIMUM_USERS_REACHED, | |
| 49 }; | |
| 50 | |
| 51 // Interface for ash client (e.g. Chrome) to set session info for ash. | |
| 52 interface SessionController { | |
| 53 // Sets the client interface. | |
| 54 SetClient(SessionControllerClient client); | |
| 55 | |
| 56 // Sets the maximum possible number of logged in users. | |
| 57 SetMaxUsers(uint32 max_users); | |
| 58 | |
| 59 // Sets whether the screen can be locked. | |
| 60 SetCanLockScreen(bool can_lock); | |
| 61 | |
| 62 // Sets whether the screen should be locked automatically before suspending. | |
| 63 SetShouldLockScreenAutomatically(bool should_lock); | |
| 64 | |
| 65 // Sets whether adding a user to session is allowed. | |
| 66 SetAddUserSessionPolicy(AddUserSessionPolicy add_user_session_policy); | |
| 67 | |
| 68 // Sets the current state of the ash session. | |
| 69 SetSessionState(SessionState session_state); | |
|
James Cook
2016/12/01 23:01:43
If all of the above functions are going to be call
xiyuan
2016/12/06 00:46:34
Makes sense. I was thinking keeping them separate
| |
| 70 | |
| 71 // Sets the list of user sessions. This list is taken as LRU sorted with | |
| 72 // the first being the currently active user session. | |
| 73 SetUserSessions(array<UserSession> user_sessions); | |
|
James Cook
2016/12/01 23:01:43
Is this going to be re-sent every time the order o
xiyuan
2016/12/06 00:46:34
Good point. I overlooked this.
Split SetUserSessi
| |
| 74 }; | |
| 75 | |
| 76 // Interface for ash to request session service from its client (e.g. Chrome). | |
| 77 interface SessionControllerClient { | |
| 78 // Requests to lock screen. | |
| 79 RequestLockScreen(); | |
| 80 | |
| 81 // Switch to the active user with |account_id| | |
| 82 // (if the user has already signed in). | |
|
James Cook
2016/12/01 23:01:43
nit: wrap with line above
xiyuan
2016/12/06 00:46:34
Done.
| |
| 83 SwitchActiveUser(string account_id); | |
| 84 | |
| 85 // Switch the active user to the next or previous user. | |
| 86 CycleActiveUser(bool next_user); | |
| 87 }; | |
| OLD | NEW |