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

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

Issue 269573010: Download and cache kiosk app extension when it is added via kiosk mamangement ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reset external_cache_ is clean up, change crx file cache dir, etc. Created 6 years, 8 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 7c1231504a1c95a8a99eafacc382390b14ffc68b..8ff08db12df8c9ff92f5e2f3912ccc1c0580a63c 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
@@ -15,6 +15,7 @@
#include "base/memory/scoped_vector.h"
#include "base/observer_list.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_data_delegate.h"
+#include "chrome/browser/chromeos/extensions/external_cache.h"
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "ui/gfx/image/image_skia.h"
@@ -36,7 +37,8 @@ class KioskAppData;
class KioskAppManagerObserver;
// KioskAppManager manages cached app data.
-class KioskAppManager : public KioskAppDataDelegate {
+class KioskAppManager : public KioskAppDataDelegate,
+ public ExternalCache::Delegate {
public:
enum ConsumerKioskAutoLaunchStatus {
// Consumer kiosk mode auto-launch feature can be enabled on this machine.
@@ -54,7 +56,7 @@ class KioskAppManager : public KioskAppDataDelegate {
// Struct to hold app info returned from GetApps() call.
struct App {
- explicit App(const KioskAppData& data);
+ App(const KioskAppData& data, bool is_extension_pending);
App();
~App();
@@ -78,6 +80,9 @@ class KioskAppManager : public KioskAppDataDelegate {
// Sub directory under DIR_USER_DATA to store cached icon files.
static const char kIconCacheDir[];
+ // Sub directory under DIR_USER_DATA to store cached crx files.
+ static const char kCrxCacheDir[];
+
// Gets the KioskAppManager instance, which is lazily created on first call..
static KioskAppManager* Get();
@@ -176,9 +181,18 @@ class KioskAppManager : public KioskAppDataDelegate {
// KioskAppDataDelegate overrides:
virtual void GetKioskAppIconCacheDir(base::FilePath* cache_dir) OVERRIDE;
+ virtual void GetKioskAppCrxCacheDir(base::FilePath* cache_dir) OVERRIDE;
virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE;
virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE;
+ // ExternalCache::Delegate:
+ virtual void OnExtensionListsUpdated(
+ const base::DictionaryValue* prefs) OVERRIDE;
+ virtual void OnExtensionLoadedInCache(const std::string& id) OVERRIDE;
+ virtual void OnExtensionDownloadFailed(
+ const std::string& id,
+ extensions::ExtensionDownloaderDelegate::Error error) OVERRIDE;
+
// Callback for EnterpriseInstallAttributes::LockDevice() during
// EnableConsumerModeKiosk() call.
void OnLockDevice(
@@ -210,6 +224,8 @@ class KioskAppManager : public KioskAppDataDelegate {
scoped_ptr<CrosSettings::ObserverSubscription>
local_account_auto_login_id_subscription_;
+ scoped_ptr<ExternalCache> external_cache_;
+
DISALLOW_COPY_AND_ASSIGN(KioskAppManager);
};

Powered by Google App Engine
This is Rietveld 408576698