#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"
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.
// 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();
// 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();
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(
AutoLoginState GetAutoLoginState() const;
void SetAutoLoginState(AutoLoginState state);
+ void GetKioskAppCrxCacheDir(base::FilePath* cache_dir);
+
// True if machine ownership is already established.
bool ownership_established_;
ScopedVector<KioskAppData> apps_;
scoped_ptr<CrosSettings::ObserverSubscription>
local_account_auto_login_id_subscription_;
+ scoped_ptr<ExternalCache> external_cache_;
+
DISALLOW_COPY_AND_ASSIGN(KioskAppManager);
};