Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: chrome/browser/chromeos/login/app_launch_controller.h

Issue 22914008: Refactor kiosk app launch to be part of login screen UI flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/app_launch_controller.h
diff --git a/chrome/browser/chromeos/login/app_launch_controller.h b/chrome/browser/chromeos/login/app_launch_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1bb749930cf5a447d6cfc35125348d5bdc7d896
--- /dev/null
+++ b/chrome/browser/chromeos/login/app_launch_controller.h
@@ -0,0 +1,82 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_CONTROLLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/timer/timer.h"
+#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
+#include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h"
+#include "chrome/browser/chromeos/app_mode/startup_app_launcher.h"
+#include "chrome/browser/chromeos/login/screens/app_launch_splash_screen_actor.h"
+
+class Profile;
+
+namespace chromeos {
+
+class LoginDisplayHost;
+class OobeDisplay;
+
+// Controller for the kiosk app launch process, responsible for
+// coordinating loading the kiosk profile, launching the app, and
+// updating the splash screen UI.
+class AppLaunchController
+ : public base::SupportsWeakPtr<AppLaunchController>,
+ public AppLaunchSplashScreenActor::Delegate,
+ public KioskProfileLoader::Delegate,
+ public StartupAppLauncher::Observer {
+ public:
+ AppLaunchController(const std::string& app_id,
+ LoginDisplayHost* host,
+ OobeDisplay* oobe_display);
+
+ virtual ~AppLaunchController();
+
+ void StartAppLaunch();
+
+ static void SkipSplashWaitForTesting();
+
+ private:
+ void Cleanup();
+
+ // KioskProfileLoader::Delegate overrides:
+ virtual void OnProfileLoaded(Profile* profile) OVERRIDE;
+ virtual void OnProfileLoadFailed(KioskAppLaunchError::Error error) OVERRIDE;
+
+ // AppLaunchSplashScreenActor::Delegate overrides:
+ virtual void OnConfigureNetwork() OVERRIDE;
+ virtual void OnCancelAppLaunch() OVERRIDE;
+
+ // StartupAppLauncher::Observer overrides:
+ virtual void OnLoadingOAuthFile() OVERRIDE;
+ virtual void OnInitializingTokenService() OVERRIDE;
+ virtual void OnInitializingNetwork() OVERRIDE;
+ virtual void OnNetworkWaitTimedout() OVERRIDE;
+ virtual void OnInstallingApp() OVERRIDE;
+ virtual void OnLaunchSucceeded() OVERRIDE;
+ virtual void OnLaunchFailed(KioskAppLaunchError::Error error) OVERRIDE;
+
+ Profile* profile_;
+ const std::string app_id_;
+ LoginDisplayHost* host_;
+ OobeDisplay* oobe_display_;
+ AppLaunchSplashScreenActor* app_launch_splash_screen_actor_;
+ scoped_ptr<KioskProfileLoader> kiosk_profile_loader_;
+ scoped_ptr<StartupAppLauncher> startup_app_launcher_;
+
+ int64 launch_splash_start_time_;
+
+ static bool skip_splash_wait_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppLaunchController);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_CONTROLLER_H_
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | chrome/browser/chromeos/login/app_launch_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698