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

Unified Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.h

Issue 300843013: Install and launch kiosk app from cached crx file at start up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the new test file from cl. Created 6 years, 5 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/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..de73768b619cb18dd05fc9e820a3731b16f4e295 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:
@@ -86,36 +85,44 @@ class StartupAppLauncher
void OnLaunchSuccess();
void OnLaunchFailure(KioskAppLaunchError::Error error);
- void MaybeInstall();
-
// Callbacks from ExtensionUpdater.
void OnUpdateCheckFinished();
void BeginInstall();
- void InstallCallback(bool success, const std::string& error);
void OnReadyToLaunch();
void UpdateAppData();
void InitializeTokenService();
void MaybeInitializeNetwork();
+ void MaybeLaunchApp();
void StartLoadingOAuthFile();
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_;
+ bool wait_for_crx_update_;
- scoped_refptr<extensions::WebstoreStandaloneInstaller> installer_;
KioskOAuthParams auth_params_;
DISALLOW_COPY_AND_ASSIGN(StartupAppLauncher);

Powered by Google App Engine
This is Rietveld 408576698