Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENTERPRISE_USER_SESSION_METRICS_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENTERPRISE_USER_SESSION_METRICS_H_ | |
| 7 | |
| 8 #include "base/time/time.h" | |
| 9 #include "components/user_manager/user_type.h" | |
| 10 | |
| 11 class PrefRegistrySimple; | |
| 12 | |
| 13 namespace chromeos { | |
| 14 | |
| 15 class UserContext; | |
| 16 | |
| 17 namespace enterprise_user_session_metrics { | |
| 18 | |
| 19 // Enum for logins metrics on an enrolled device. | |
| 20 enum SignInEventType { | |
|
achuithb
2017/02/15 10:54:57
enum class is preferred now I believe:
https://gro
xiyuan
2017/02/15 19:08:10
Done.
| |
| 21 // A regular user login. | |
| 22 REGULAR_USER = 0, | |
| 23 // Manually started public session. | |
| 24 MANUAL_PUBLIC_SESSION = 1, | |
| 25 // Automatically started public session. | |
| 26 AUTOMATIC_PUBLIC_SESSSION = 2, | |
| 27 // Manually started kiosk session. | |
| 28 MANUAL_KIOSK = 3, | |
| 29 // Automatically started kiosk session. | |
| 30 AUTOMATIC_KIOSK = 4, | |
| 31 // Count of sign-in event types. Must be the last one. | |
| 32 SIGN_IN_EVENT_COUNT, | |
| 33 }; | |
| 34 | |
| 35 // Register local state preferences. | |
| 36 void RegisterPrefs(PrefRegistrySimple* registry); | |
| 37 | |
| 38 // Records a sign-in event for an enrolled device. | |
| 39 void RecordSignInEvent(SignInEventType sign_in_event_type); | |
| 40 | |
| 41 // Records a sign-in event by UserContext for an enrolled device. | |
|
achuithb
2017/02/15 10:54:57
Is is_auto_login well understood in this part of t
xiyuan
2017/02/15 19:08:10
Added comment to document what |is_auto_login| rep
| |
| 42 void RecordSignInEvent(const UserContext& user_context, bool is_auto_login); | |
| 43 | |
| 44 // Stores session length for regular user, public session user for enrolled | |
| 45 // device to be reported on the next run. It stores the duration in a local | |
| 46 // state pref instead of sending it to metrics code directly because it is | |
| 47 // called on shutdown path and metrics are likely to lost. The stored value | |
|
achuithb
2017/02/15 10:54:57
to be lost.
xiyuan
2017/02/15 19:08:10
Done.
| |
| 48 // would be reported on the next run. | |
| 49 void StoreSessionLength(user_manager::UserType session_type, | |
| 50 const base::TimeDelta& session_length); | |
| 51 | |
| 52 // Records the stored session length and clears it. | |
| 53 void RecordStoredSessionLength(); | |
| 54 | |
| 55 } // namespace enterprise_user_session_metrics | |
| 56 } // namespace chromeos | |
| 57 | |
| 58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENTERPRISE_USER_SESSION_METRICS_H_ | |
| OLD | NEW |