| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include <utility> | 9 #include <utility> | 
| 10 | 10 | 
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 173     const base::ListValue* args) { | 173     const base::ListValue* args) { | 
| 174   KioskAppLaunchError::Error error = KioskAppLaunchError::Get(); | 174   KioskAppLaunchError::Error error = KioskAppLaunchError::Get(); | 
| 175   if (error == KioskAppLaunchError::NONE) | 175   if (error == KioskAppLaunchError::NONE) | 
| 176     return; | 176     return; | 
| 177   KioskAppLaunchError::RecordMetricAndClear(); | 177   KioskAppLaunchError::RecordMetricAndClear(); | 
| 178 | 178 | 
| 179   const std::string error_message = KioskAppLaunchError::GetErrorMessage(error); | 179   const std::string error_message = KioskAppLaunchError::GetErrorMessage(error); | 
| 180   bool new_kiosk_ui = EnableNewKioskUI(); | 180   bool new_kiosk_ui = EnableNewKioskUI(); | 
| 181   web_ui()->CallJavascriptFunctionUnsafe( | 181   web_ui()->CallJavascriptFunctionUnsafe( | 
| 182       new_kiosk_ui ? kKioskShowErrorNewAPI : kKioskShowErrorOldAPI, | 182       new_kiosk_ui ? kKioskShowErrorNewAPI : kKioskShowErrorOldAPI, | 
| 183       base::StringValue(error_message)); | 183       base::Value(error_message)); | 
| 184 } | 184 } | 
| 185 | 185 | 
| 186 void KioskAppMenuHandler::OnKioskAppsSettingsChanged() { | 186 void KioskAppMenuHandler::OnKioskAppsSettingsChanged() { | 
| 187   SendKioskApps(); | 187   SendKioskApps(); | 
| 188 } | 188 } | 
| 189 | 189 | 
| 190 void KioskAppMenuHandler::OnKioskAppDataChanged(const std::string& app_id) { | 190 void KioskAppMenuHandler::OnKioskAppDataChanged(const std::string& app_id) { | 
| 191   SendKioskApps(); | 191   SendKioskApps(); | 
| 192 } | 192 } | 
| 193 | 193 | 
| 194 void KioskAppMenuHandler::OnKioskAppDataLoadFailure(const std::string& app_id) { | 194 void KioskAppMenuHandler::OnKioskAppDataLoadFailure(const std::string& app_id) { | 
| 195   SendKioskApps(); | 195   SendKioskApps(); | 
| 196 } | 196 } | 
| 197 | 197 | 
| 198 void KioskAppMenuHandler::UpdateState(NetworkError::ErrorReason reason) { | 198 void KioskAppMenuHandler::UpdateState(NetworkError::ErrorReason reason) { | 
| 199   if (network_state_informer_->state() == NetworkStateInformer::ONLINE) | 199   if (network_state_informer_->state() == NetworkStateInformer::ONLINE) | 
| 200     KioskAppManager::Get()->RetryFailedAppDataFetch(); | 200     KioskAppManager::Get()->RetryFailedAppDataFetch(); | 
| 201 } | 201 } | 
| 202 | 202 | 
| 203 void KioskAppMenuHandler::OnArcKioskAppsChanged() { | 203 void KioskAppMenuHandler::OnArcKioskAppsChanged() { | 
| 204   SendKioskApps(); | 204   SendKioskApps(); | 
| 205 } | 205 } | 
| 206 | 206 | 
| 207 }  // namespace chromeos | 207 }  // namespace chromeos | 
| OLD | NEW | 
|---|