Index: chrome/browser/chromeos/app_mode/kiosk_app_manager.cc |
=================================================================== |
--- chrome/browser/chromeos/app_mode/kiosk_app_manager.cc (revision 246680) |
+++ chrome/browser/chromeos/app_mode/kiosk_app_manager.cc (working copy) |
@@ -269,6 +269,7 @@ |
} |
void KioskAppManager::GetApps(Apps* apps) const { |
+ apps->clear(); |
apps->reserve(apps_.size()); |
for (size_t i = 0; i < apps_.size(); ++i) |
apps->push_back(App(*apps_[i])); |
@@ -302,6 +303,25 @@ |
return false; |
} |
+void KioskAppManager::ClearAppData(const std::string& app_id) { |
+ KioskAppData* app_data = GetAppDataMutable(app_id); |
+ if (!app_data) |
+ return; |
+ |
+ app_data->ClearCache(); |
+} |
+ |
+void KioskAppManager::UpdateAppDataFromProfile( |
+ const std::string& app_id, |
+ Profile* profile, |
+ const extensions::Extension* app) { |
+ KioskAppData* app_data = GetAppDataMutable(app_id); |
+ if (!app_data) |
+ return; |
+ |
+ app_data->LoadFromInstalledApp(profile, app); |
+} |
+ |
void KioskAppManager::AddObserver(KioskAppManagerObserver* observer) { |
observers_.AddObserver(observer); |
} |
@@ -341,6 +361,10 @@ |
return NULL; |
} |
+KioskAppData* KioskAppManager::GetAppDataMutable(const std::string& app_id) { |
+ return const_cast<KioskAppData*>(GetAppData(app_id)); |
+} |
+ |
void KioskAppManager::UpdateAppData() { |
// Gets app id to data mapping for existing apps. |
std::map<std::string, KioskAppData*> old_apps; |