| Index: chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc
|
| diff --git a/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc b/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc
|
| index ad7fa148b2a57af14224a71b7962c99a20598631..82561cb74398996daf2e113a10506e5b860d7ab6 100644
|
| --- a/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc
|
| +++ b/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc
|
| @@ -178,25 +178,22 @@ void KioskAppsHandler::GetLocalizedValues(content::WebUIDataSource* source) {
|
| }
|
|
|
| void KioskAppsHandler::OnKioskAppDataChanged(const std::string& app_id) {
|
| - KioskAppManager::App app_data;
|
| - if (!kiosk_app_manager_->GetApp(app_id, &app_data))
|
| - return;
|
| -
|
| - base::DictionaryValue app_dict;
|
| - PopulateAppDict(app_data, &app_dict);
|
| -
|
| - web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.updateApp",
|
| - app_dict);
|
| + UpdateApp(app_id);
|
| }
|
|
|
| void KioskAppsHandler::OnKioskAppDataLoadFailure(const std::string& app_id) {
|
| - base::StringValue app_id_value(app_id);
|
| - web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.showError",
|
| - app_id_value);
|
| + ShowError(app_id);
|
| +}
|
|
|
| - kiosk_app_manager_->RemoveApp(app_id);
|
| +void KioskAppsHandler::OnKioskExtensionLoadedInCache(
|
| + const std::string& app_id) {
|
| + UpdateApp(app_id);
|
| }
|
|
|
| +void KioskAppsHandler::OnKioskExtensionDownloadFailed(
|
| + const std::string& app_id) {
|
| + ShowError(app_id);
|
| +}
|
|
|
| void KioskAppsHandler::OnGetConsumerKioskAutoLaunchStatus(
|
| chromeos::KioskAppManager::ConsumerKioskAutoLaunchStatus status) {
|
| @@ -333,4 +330,24 @@ void KioskAppsHandler::HandleSetDisableBailoutShortcut(
|
| !disable_bailout_shortcut);
|
| }
|
|
|
| +void KioskAppsHandler::UpdateApp(const std::string& app_id) {
|
| + KioskAppManager::App app_data;
|
| + if (!kiosk_app_manager_->GetApp(app_id, &app_data))
|
| + return;
|
| +
|
| + base::DictionaryValue app_dict;
|
| + PopulateAppDict(app_data, &app_dict);
|
| +
|
| + web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.updateApp",
|
| + app_dict);
|
| +}
|
| +
|
| +void KioskAppsHandler::ShowError(const std::string& app_id) {
|
| + base::StringValue app_id_value(app_id);
|
| + web_ui()->CallJavascriptFunction("extensions.KioskAppsOverlay.showError",
|
| + app_id_value);
|
| +
|
| + kiosk_app_manager_->RemoveApp(app_id);
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|