kiosk_app_launch_error.h revision a93a17c8d99d686bd4a1511e5504e5e6cc9fcadf
1// Copyright 2013 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_APP_MODE_KIOSK_APP_LAUNCH_ERROR_H_ 6#define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_LAUNCH_ERROR_H_ 7 8#include <string> 9 10#include "base/basictypes.h" 11 12namespace chromeos { 13 14class KioskAppLaunchError { 15 public: 16 enum Error { 17 NONE, // No error. 18 HAS_PENDING_LAUNCH, // There is a pending launch already. 19 CRYPTOHOMED_NOT_RUNNING, // Unable to call cryptohome daemon. 20 ALREADY_MOUNTED, // Cryptohome is already mounted. 21 UNABLE_TO_MOUNT, // Unable to mount cryptohome. 22 UNABLE_TO_REMOVE, // Unable to remove cryptohome. 23 UNABLE_TO_INSTALL, // Unable to install app. 24 USER_CANCEL, // Canceled by user. 25 NOT_KIOSK_ENABLED, // Not a kiosk enabled app. 26 UNABLE_TO_RETRIEVE_HASH, // Unable to retrieve username hash. 27 }; 28 29 // Returns a message for given |error|. 30 static std::string GetErrorMessage(Error error); 31 32 // Save error for displaying on next restart. Note only the last saved error 33 // will be kept. 34 static void Save(Error error); 35 36 // Gets the saved error. 37 static Error Get(); 38 39 // Clears the saved error. 40 static void Clear(); 41 42 private: 43 DISALLOW_IMPLICIT_CONSTRUCTORS(KioskAppLaunchError); 44}; 45 46} // namespace chromeos 47 48#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_LAUNCH_ERROR_H_ 49