Chromium Code Reviews| Index: chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h |
| diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h b/chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h |
| index 1f5f2efd0ed8ee994e5cb9e8c1e05319094eb48a..56397aafead3abeb00a19e7c076bc1a73cae2910 100644 |
| --- a/chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h |
| +++ b/chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h |
| @@ -11,37 +11,45 @@ |
| namespace chromeos { |
| +class AuthFailure; |
| + |
| class KioskAppLaunchError { |
| public: |
| + // Enum used for UMA. Do NOT reorder or remove entry. Don't forget to |
| + // update histograms.xml when adding new entries. |
| enum Error { |
| - NONE, // No error. |
| - HAS_PENDING_LAUNCH, // There is a pending launch already. |
| - CRYPTOHOMED_NOT_RUNNING, // Unable to call cryptohome daemon. |
| - ALREADY_MOUNTED, // Cryptohome is already mounted. |
| - UNABLE_TO_MOUNT, // Unable to mount cryptohome. |
| - UNABLE_TO_REMOVE, // Unable to remove cryptohome. |
| - UNABLE_TO_INSTALL, // Unable to install app. |
| - USER_CANCEL, // Canceled by user. |
| - NOT_KIOSK_ENABLED, // Not a kiosk enabled app. |
| - UNABLE_TO_RETRIEVE_HASH, // Unable to retrieve username hash. |
| - POLICY_LOAD_FAILED, // Failed to load policy for kiosk account. |
| - UNABLE_TO_DOWNLOAD, // Unable to download app's crx file. |
| - UNABLE_TO_LAUNCH, // Unable to launch app. |
| - ARC_AUTH_FAILED, // Failed to authorise ARC session |
| + NONE = 0, // No error. |
| + HAS_PENDING_LAUNCH = 1, // There is a pending launch already. |
| + CRYPTOHOMED_NOT_RUNNING = 2, // Unable to call cryptohome daemon. |
| + ALREADY_MOUNTED = 3, // Cryptohome is already mounted. |
| + UNABLE_TO_MOUNT = 4, // Unable to mount cryptohome. |
| + UNABLE_TO_REMOVE = 5, // Unable to remove cryptohome. |
| + UNABLE_TO_INSTALL = 6, // Unable to install app. |
| + USER_CANCEL = 7, // Canceled by user. |
| + NOT_KIOSK_ENABLED = 8, // Not a kiosk enabled app. |
| + UNABLE_TO_RETRIEVE_HASH = 9, // Unable to retrieve username hash. |
| + POLICY_LOAD_FAILED = 10, // Failed to load policy for kiosk account. |
| + UNABLE_TO_DOWNLOAD = 11, // Unable to download app's crx file. |
| + UNABLE_TO_LAUNCH = 12, // Unable to launch app. |
| + ARC_AUTH_FAILED = 13, // Failed to authorise ARC session |
| + ERROR_COUNT, // Count of all errors. Must be the last one. |
|
tbarzic
2017/02/28 19:18:55
I'd remove "Must be at least one" - there already
xiyuan
2017/02/28 21:14:57
Done.
|
| }; |
| // Returns a message for given |error|. |
| static std::string GetErrorMessage(Error error); |
| - // Save error for displaying on next restart. Note only the last saved error |
| - // will be kept. |
| + // Saves error for displaying and metric reporting on next chrome run. |
|
tbarzic
2017/02/28 19:18:55
nit: how about:
"Saves a launch error - used on th
xiyuan
2017/02/28 21:14:57
Done.
|
| + // Note only the last saved error will be kept. |
| static void Save(Error error); |
| + // Saves cryptohome auth error for metric report on the next chrome run. |
| + static void SaveCryptohomeFailure(const AuthFailure& auth_failure); |
| + |
| // Gets the saved error. |
| static Error Get(); |
| - // Clears the saved error. |
| - static void Clear(); |
| + // Records the launch error metric and clears it. |
| + static void RecordMetricAndClear(); |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(KioskAppLaunchError); |