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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_app_manager.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 useless offline_enabled_app_profile testing data. 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/kiosk_app_manager.h
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
index a26939e1ba2d7f2932d42fe1df7ccecc5db49155..30caf1207a24510a393a33ff1eaa223580afbab1 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
@@ -29,11 +29,13 @@ class RefCountedString;
namespace extensions {
class Extension;
+class ExternalLoader;
}
namespace chromeos {
class KioskAppData;
+class KioskAppExternalLoader;
class KioskAppManagerObserver;
// KioskAppManager manages cached app data.
@@ -152,14 +154,29 @@ class KioskAppManager : public KioskAppDataDelegate,
void RetryFailedAppDataFetch();
+ // Returns true if the app is found in cache.
+ bool HasCachedCrx(const std::string& app_id) const;
+
void AddObserver(KioskAppManagerObserver* observer);
void RemoveObserver(KioskAppManagerObserver* observer);
+ // Creates extensions::ExternalLoader for installing kiosk apps during their
+ // first time launch.
+ extensions::ExternalLoader* CreateExternalLoader();
+
+ // Installs kiosk app with |id| from cache.
+ void InstallFromCache(const std::string& id);
+
+ void UpdateExternalCache();
+
+ bool external_loader_created() const { return external_loader_created_; }
+
private:
friend struct base::DefaultLazyInstanceTraits<KioskAppManager>;
friend struct base::DefaultDeleter<KioskAppManager>;
friend class KioskAppManagerTest;
friend class KioskTest;
+ friend class KioskUpdateTest;
enum AutoLoginState {
AUTOLOGIN_NONE = 0,
@@ -178,7 +195,7 @@ class KioskAppManager : public KioskAppDataDelegate,
const KioskAppData* GetAppData(const std::string& app_id) const;
KioskAppData* GetAppDataMutable(const std::string& app_id);
- // Update app data |apps_| based on CrosSettings.
+ // Updates app data |apps_| based on CrosSettings.
void UpdateAppData();
// KioskAppDataDelegate overrides:
@@ -216,9 +233,11 @@ class KioskAppManager : public KioskAppDataDelegate,
void GetCrxCacheDir(base::FilePath* cache_dir);
+ // Gets the file path and version information of the cached crx with |app_id|.
+ // Returns true if the app is found in cache.
bool GetCachedCrx(const std::string& app_id,
base::FilePath* file_path,
- std::string* version);
+ std::string* version) const;
// True if machine ownership is already established.
bool ownership_established_;
@@ -233,6 +252,10 @@ class KioskAppManager : public KioskAppDataDelegate,
scoped_ptr<ExternalCache> external_cache_;
+ // The extension external loader for installing kiosk app.
+ bool external_loader_created_;
+ base::WeakPtr<KioskAppExternalLoader> external_loader_;
+
DISALLOW_COPY_AND_ASSIGN(KioskAppManager);
};
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_launch_error.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698