#ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_
#define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
#include "chrome/browser/chromeos/login/login_performer.h"
#include "chrome/browser/chromeos/login/login_utils.h"
class Profile;
namespace chromeos {
class KioskProfileLoader : public LoginPerformer::Delegate,
public LoginUtils::Delegate {
public:
class Delegate {
public:
virtual void OnProfileLoaded(Profile* profile) = 0;
virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) = 0;
protected:
virtual ~Delegate() {}
};
KioskProfileLoader(const std::string& app_user_id,
bool use_guest_mount,
Delegate* delegate);
virtual ~KioskProfileLoader();
void Start();
private:
class CryptohomedChecker;
void LoginAsKioskAccount();
void ReportLaunchResult(KioskAppLaunchError::Error error);
virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE;
virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE;
virtual void WhiteListCheckFailed(const std::string& email) OVERRIDE;
virtual void PolicyLoadFailed() OVERRIDE;
virtual void OnOnlineChecked(
const std::string& email, bool success) OVERRIDE;
virtual void OnProfilePrepared(Profile* profile) OVERRIDE;
std::string user_id_;
bool use_guest_mount_;
Delegate* delegate_;
scoped_ptr<CryptohomedChecker> cryptohomed_checker_;
scoped_ptr<LoginPerformer> login_performer_;
DISALLOW_COPY_AND_ASSIGN(KioskProfileLoader);
};
}
#endif