| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 class Delegate { | 29 class Delegate { |
| 30 public: | 30 public: |
| 31 virtual void OnProfileLoaded(Profile* profile) = 0; | 31 virtual void OnProfileLoaded(Profile* profile) = 0; |
| 32 virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) = 0; | 32 virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) = 0; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 KioskProfileLoader(KioskAppManager* kiosk_app_manager, | 38 KioskProfileLoader(const std::string& app_user_id, |
| 39 const std::string& app_id, | 39 bool force_ephemeral, |
| 40 Delegate* delegate); | 40 Delegate* delegate); |
| 41 | 41 |
| 42 virtual ~KioskProfileLoader(); | 42 virtual ~KioskProfileLoader(); |
| 43 | 43 |
| 44 // Starts profile load. Calls delegate on success or failure. | 44 // Starts profile load. Calls delegate on success or failure. |
| 45 void Start(); | 45 void Start(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 class CryptohomedChecker; | 48 class CryptohomedChecker; |
| 49 | 49 |
| 50 void LoginAsKioskAccount(); | 50 void LoginAsKioskAccount(); |
| 51 void ReportLaunchResult(KioskAppLaunchError::Error error); | 51 void ReportLaunchResult(KioskAppLaunchError::Error error); |
| 52 | 52 |
| 53 // LoginPerformer::Delegate overrides | 53 // LoginPerformer::Delegate overrides |
| 54 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE; | 54 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE; |
| 55 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE; | 55 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE; |
| 56 virtual void WhiteListCheckFailed(const std::string& email) OVERRIDE; | 56 virtual void WhiteListCheckFailed(const std::string& email) OVERRIDE; |
| 57 virtual void PolicyLoadFailed() OVERRIDE; | 57 virtual void PolicyLoadFailed() OVERRIDE; |
| 58 virtual void OnOnlineChecked( | 58 virtual void OnOnlineChecked( |
| 59 const std::string& email, bool success) OVERRIDE; | 59 const std::string& email, bool success) OVERRIDE; |
| 60 | 60 |
| 61 // LoginUtils::Delegate implementation: | 61 // LoginUtils::Delegate implementation: |
| 62 virtual void OnProfilePrepared(Profile* profile) OVERRIDE; | 62 virtual void OnProfilePrepared(Profile* profile) OVERRIDE; |
| 63 | 63 |
| 64 KioskAppManager* kiosk_app_manager_; | |
| 65 const std::string app_id_; | |
| 66 std::string user_id_; | 64 std::string user_id_; |
| 65 bool force_ephemeral_; |
| 67 Delegate* delegate_; | 66 Delegate* delegate_; |
| 68 scoped_ptr<CryptohomedChecker> cryptohomed_checker_; | 67 scoped_ptr<CryptohomedChecker> cryptohomed_checker_; |
| 69 scoped_ptr<LoginPerformer> login_performer_; | 68 scoped_ptr<LoginPerformer> login_performer_; |
| 70 | 69 |
| 71 DISALLOW_COPY_AND_ASSIGN(KioskProfileLoader); | 70 DISALLOW_COPY_AND_ASSIGN(KioskProfileLoader); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace chromeos | 73 } // namespace chromeos |
| 75 | 74 |
| 76 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_PROFILE_LOADER_H_ |
| OLD | NEW |