OLD | NEW |
(Empty) | |
| 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_LOGIN_APP_LAUNCH_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_CONTROLLER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/timer/timer.h" |
| 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
| 15 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" |
| 16 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" |
| 17 #include "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h
" |
| 18 |
| 19 class Profile; |
| 20 |
| 21 namespace chromeos { |
| 22 |
| 23 class LoginDisplayHost; |
| 24 class OobeDisplay; |
| 25 |
| 26 // Controller for the kiosk app launch process, responsible for |
| 27 // coordinating loading the kiosk profile, launching the app, and |
| 28 // updating the splash screen UI. |
| 29 class AppLaunchController |
| 30 : public base::SupportsWeakPtr<AppLaunchController>, |
| 31 public AppLaunchSplashScreenActor::Delegate, |
| 32 public KioskProfileLoader::Delegate, |
| 33 public StartupAppLauncher::Observer { |
| 34 public: |
| 35 AppLaunchController(const std::string& app_id, |
| 36 LoginDisplayHost* host, |
| 37 OobeDisplay* oobe_display); |
| 38 |
| 39 virtual ~AppLaunchController(); |
| 40 |
| 41 void StartAppLaunch(); |
| 42 |
| 43 static void SkipSplashWaitForTesting(); |
| 44 |
| 45 private: |
| 46 void Cleanup(); |
| 47 |
| 48 // KioskProfileLoader::Delegate overrides: |
| 49 virtual void OnProfileLoaded(Profile* profile) OVERRIDE; |
| 50 virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) OVERRIDE; |
| 51 |
| 52 // AppLaunchSplashScreenActor::Delegate overrides: |
| 53 virtual void OnConfigureNetwork() OVERRIDE; |
| 54 virtual void OnCancelAppLaunch() OVERRIDE; |
| 55 |
| 56 // StartupAppLauncher::Observer overrides: |
| 57 virtual void OnLoadingOAuthFile() OVERRIDE; |
| 58 virtual void OnInitializingTokenService() OVERRIDE; |
| 59 virtual void OnInitializingNetwork() OVERRIDE; |
| 60 virtual void OnNetworkWaitTimedout() OVERRIDE; |
| 61 virtual void OnInstallingApp() OVERRIDE; |
| 62 virtual void OnLaunchSucceeded() OVERRIDE; |
| 63 virtual void OnLaunchFailed(KioskAppLaunchError::Error error) OVERRIDE; |
| 64 |
| 65 Profile* profile_; |
| 66 const std::string app_id_; |
| 67 LoginDisplayHost* host_; |
| 68 OobeDisplay* oobe_display_; |
| 69 AppLaunchSplashScreenActor* app_launch_splash_screen_actor_; |
| 70 scoped_ptr<KioskProfileLoader> kiosk_profile_loader_; |
| 71 scoped_ptr<StartupAppLauncher> startup_app_launcher_; |
| 72 |
| 73 int64 launch_splash_start_time_; |
| 74 |
| 75 static bool skip_splash_wait_; |
| 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(AppLaunchController); |
| 78 }; |
| 79 |
| 80 } // namespace chromeos |
| 81 |
| 82 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_CONTROLLER_H_ |
OLD | NEW |