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..599a6cda2d8c5612659dd23e451ed0eedbcd332f 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,46 @@ |
| 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. |
| }; |
| // 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 a launch error. The error is used on the next Chrome run to report |
| + // metrics and display a message to the user. |
| static void Save(Error error); |
| + // Saves a cryptohome auth error. The error is used for metrics 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. |
|
Ilya Sherman
2017/03/01 00:44:26
Perhaps document that this method records and clea
xiyuan
2017/03/01 17:01:35
Done.
|
| + static void RecordMetricAndClear(); |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(KioskAppLaunchError); |