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

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

Issue 491403003: Update cached kiosk app crx from usb stick. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor optimization in test. Created 6 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/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 30caf1207a24510a393a33ff1eaa223580afbab1..b9a3c9bee2607388a24aa58b2109321105c6db47 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
@@ -37,6 +37,7 @@ namespace chromeos {
class KioskAppData;
class KioskAppExternalLoader;
class KioskAppManagerObserver;
+class KioskExternalUpdater;
// KioskAppManager manages cached app data.
class KioskAppManager : public KioskAppDataDelegate,
@@ -85,6 +86,10 @@ class KioskAppManager : public KioskAppDataDelegate,
// Sub directory under DIR_USER_DATA to store cached crx files.
static const char kCrxCacheDir[];
+ // Sub directory under DIR_USER_DATA to store unpacked crx file for validating
+ // its signature.
+ static const char kCrxUnpackDir[];
+
// Gets the KioskAppManager instance, which is lazily created on first call..
static KioskAppManager* Get();
@@ -157,6 +162,12 @@ class KioskAppManager : public KioskAppDataDelegate,
// Returns true if the app is found in cache.
bool HasCachedCrx(const std::string& app_id) const;
+ // Gets the path and version 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) const;
+
void AddObserver(KioskAppManagerObserver* observer);
void RemoveObserver(KioskAppManagerObserver* observer);
@@ -169,6 +180,19 @@ class KioskAppManager : public KioskAppDataDelegate,
void UpdateExternalCache();
+ // Monitors kiosk external update from usb stick.
+ void MonitorKioskExternalUpdate();
+
+ // Invoked when kiosk app cache has been updated.
+ void OnKioskAppCacheUpdated(const std::string& app_id);
+
+ // Installs the validated external extension into cache.
+ void PutValidatedExternalExtension(
+ const std::string& app_id,
+ const base::FilePath& crx_path,
+ const std::string& version,
+ const ExternalCache::PutExternalExtensionCallback& callback);
+
bool external_loader_created() const { return external_loader_created_; }
private:
@@ -232,12 +256,7 @@ class KioskAppManager : public KioskAppDataDelegate,
void SetAutoLoginState(AutoLoginState state);
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) const;
+ void GetCrxUnpackDir(base::FilePath* unpack_dir);
// True if machine ownership is already established.
bool ownership_established_;
@@ -251,6 +270,7 @@ class KioskAppManager : public KioskAppDataDelegate,
local_account_auto_login_id_subscription_;
scoped_ptr<ExternalCache> external_cache_;
+ scoped_ptr<KioskExternalUpdater> usb_stick_updater_;
// The extension external loader for installing kiosk app.
bool external_loader_created_;
« no previous file with comments | « chrome/browser/chromeos/app_mode/app_session_lifetime.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