Index: chrome/browser/chromeos/app_mode/startup_app_launcher.h |
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.h b/chrome/browser/chromeos/app_mode/startup_app_launcher.h |
index e13225abc98c1911a184e4d9bc8ab469c2330d1d..3f63af527ba738d0e46eb9ff0c289ef50285fe4a 100644 |
--- a/chrome/browser/chromeos/app_mode/startup_app_launcher.h |
+++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.h |
@@ -11,14 +11,12 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
+#include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" |
+#include "chrome/browser/extensions/install_observer.h" |
#include "google_apis/gaia/oauth2_token_service.h" |
class Profile; |
-namespace extensions { |
-class WebstoreStandaloneInstaller; |
-} |
- |
namespace chromeos { |
// Launches the app at startup. The flow roughly looks like this: |
@@ -31,9 +29,10 @@ namespace chromeos { |
// - After the app is installed/updated, launch it and finish the flow; |
// Report OnLauncherInitialized() or OnLaunchFailed() to observers: |
// - If all goes good, launches the app and finish the flow; |
-class StartupAppLauncher |
- : public base::SupportsWeakPtr<StartupAppLauncher>, |
- public OAuth2TokenService::Observer { |
+class StartupAppLauncher : public base::SupportsWeakPtr<StartupAppLauncher>, |
+ public OAuth2TokenService::Observer, |
+ public extensions::InstallObserver, |
+ public KioskAppManagerObserver { |
public: |
class Delegate { |
public: |
@@ -92,7 +91,6 @@ class StartupAppLauncher |
void OnUpdateCheckFinished(); |
void BeginInstall(); |
- void InstallCallback(bool success, const std::string& error); |
void OnReadyToLaunch(); |
void UpdateAppData(); |
@@ -103,19 +101,31 @@ class StartupAppLauncher |
static void LoadOAuthFileOnBlockingPool(KioskOAuthParams* auth_params); |
void OnOAuthFileLoaded(KioskOAuthParams* auth_params); |
+ void OnKioskAppDataLoadStatusChanged(const std::string& app_id); |
+ |
// OAuth2TokenService::Observer overrides. |
virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE; |
virtual void OnRefreshTokensLoaded() OVERRIDE; |
+ // extensions::InstallObserver overrides. |
+ virtual void OnFinishCrxInstall(const std::string& extension_id, |
+ bool success) OVERRIDE; |
+ |
+ // KioskAppManagerObserver overrides. |
+ virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE; |
+ virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE; |
+ |
Profile* profile_; |
const std::string app_id_; |
const bool diagnostic_mode_; |
Delegate* delegate_; |
bool network_ready_handled_; |
- int install_attempt_; |
+ int launch_attempt_; |
bool ready_to_launch_; |
+ // The crx file is ready for installation if it is not pending for download |
+ // or update check with KioskAppManager. |
+ bool crx_ready_for_install_; |
- scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_; |
KioskOAuthParams auth_params_; |
DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher); |