OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/error_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 &ErrorScreenHandler::HandleConfigureCerts); | 215 &ErrorScreenHandler::HandleConfigureCerts); |
216 AddCallback("launchOobeGuestSession", | 216 AddCallback("launchOobeGuestSession", |
217 &ErrorScreenHandler::HandleLaunchOobeGuestSession); | 217 &ErrorScreenHandler::HandleLaunchOobeGuestSession); |
218 } | 218 } |
219 | 219 |
220 void ErrorScreenHandler::DeclareLocalizedValues( | 220 void ErrorScreenHandler::DeclareLocalizedValues( |
221 LocalizedValuesBuilder* builder) { | 221 LocalizedValuesBuilder* builder) { |
222 builder->Add("loginErrorTitle", IDS_LOGIN_ERROR_TITLE); | 222 builder->Add("loginErrorTitle", IDS_LOGIN_ERROR_TITLE); |
223 builder->Add("signinOfflineMessageBody", IDS_LOGIN_OFFLINE_MESSAGE); | 223 builder->Add("signinOfflineMessageBody", IDS_LOGIN_OFFLINE_MESSAGE); |
224 builder->Add("kioskOfflineMessageBody", IDS_KIOSK_OFFLINE_MESSAGE); | 224 builder->Add("kioskOfflineMessageBody", IDS_KIOSK_OFFLINE_MESSAGE); |
225 builder->Add("kioskOnlineTitle", IDS_LOGIN_NETWORK_RESTORED_TITLE); | |
226 builder->Add("kioskOnlineMessageBody", IDS_KIOSK_ONLINE_MESSAGE); | |
227 builder->Add("autoEnrollmentOfflineMessageBody", | 225 builder->Add("autoEnrollmentOfflineMessageBody", |
228 IDS_LOGIN_AUTO_ENROLLMENT_OFFLINE_MESSAGE); | 226 IDS_LOGIN_AUTO_ENROLLMENT_OFFLINE_MESSAGE); |
229 builder->Add("captivePortalTitle", IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_TITLE); | 227 builder->Add("captivePortalTitle", IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_TITLE); |
230 builder->Add("captivePortalMessage", IDS_LOGIN_MAYBE_CAPTIVE_PORTAL); | 228 builder->Add("captivePortalMessage", IDS_LOGIN_MAYBE_CAPTIVE_PORTAL); |
231 builder->Add("captivePortalProxyMessage", | 229 builder->Add("captivePortalProxyMessage", |
232 IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_PROXY); | 230 IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_PROXY); |
233 builder->Add("captivePortalNetworkSelect", | 231 builder->Add("captivePortalNetworkSelect", |
234 IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_NETWORK_SELECT); | 232 IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_NETWORK_SELECT); |
235 builder->Add("signinProxyMessageText", IDS_LOGIN_PROXY_ERROR_MESSAGE); | 233 builder->Add("signinProxyMessageText", IDS_LOGIN_PROXY_ERROR_MESSAGE); |
236 builder->Add("updateOfflineMessageBody", IDS_UPDATE_OFFLINE_MESSAGE); | 234 builder->Add("updateOfflineMessageBody", IDS_UPDATE_OFFLINE_MESSAGE); |
237 builder->Add("updateProxyMessageText", IDS_UPDATE_PROXY_ERROR_MESSAGE); | 235 builder->Add("updateProxyMessageText", IDS_UPDATE_PROXY_ERROR_MESSAGE); |
238 builder->AddF("localStateErrorText0", IDS_LOCAL_STATE_ERROR_TEXT_0, | 236 builder->AddF("localStateErrorText0", IDS_LOCAL_STATE_ERROR_TEXT_0, |
239 IDS_SHORT_PRODUCT_NAME); | 237 IDS_SHORT_PRODUCT_NAME); |
240 builder->Add("localStateErrorText1", IDS_LOCAL_STATE_ERROR_TEXT_1); | 238 builder->Add("localStateErrorText1", IDS_LOCAL_STATE_ERROR_TEXT_1); |
241 builder->Add("localStateErrorPowerwashButton", | 239 builder->Add("localStateErrorPowerwashButton", |
242 IDS_LOCAL_STATE_ERROR_POWERWASH_BUTTON); | 240 IDS_LOCAL_STATE_ERROR_POWERWASH_BUTTON); |
243 builder->Add("connectingIndicatorText", IDS_LOGIN_CONNECTING_INDICATOR_TEXT); | 241 builder->Add("connectingIndicatorText", IDS_LOGIN_CONNECTING_INDICATOR_TEXT); |
244 builder->Add("guestSigninFixNetwork", IDS_LOGIN_GUEST_SIGNIN_FIX_NETWORK); | 242 builder->Add("guestSigninFixNetwork", IDS_LOGIN_GUEST_SIGNIN_FIX_NETWORK); |
245 builder->Add("rebootButton", IDS_RELAUNCH_BUTTON); | 243 builder->Add("rebootButton", IDS_RELAUNCH_BUTTON); |
246 builder->Add("diagnoseButton", IDS_DIAGNOSE_BUTTON); | 244 builder->Add("diagnoseButton", IDS_DIAGNOSE_BUTTON); |
247 builder->Add("configureCertsButton", IDS_MANAGE_CERTIFICATES); | 245 builder->Add("configureCertsButton", IDS_MANAGE_CERTIFICATES); |
248 builder->Add("continueButton", IDS_NETWORK_SELECTION_CONTINUE_BUTTON); | |
249 } | 246 } |
250 | 247 |
251 void ErrorScreenHandler::Initialize() { | 248 void ErrorScreenHandler::Initialize() { |
252 if (!page_is_ready()) | 249 if (!page_is_ready()) |
253 return; | 250 return; |
254 if (show_on_init_) { | 251 if (show_on_init_) { |
255 base::DictionaryValue params; | 252 base::DictionaryValue params; |
256 params.SetInteger("uiState", static_cast<int>(ui_state_)); | 253 params.SetInteger("uiState", static_cast<int>(ui_state_)); |
257 params.SetInteger("errorState", static_cast<int>(error_state_)); | 254 params.SetInteger("errorState", static_cast<int>(error_state_)); |
258 params.SetString("network", network_); | 255 params.SetString("network", network_); |
259 params.SetBoolean("guestSigninAllowed", guest_signin_allowed_); | 256 params.SetBoolean("guestSigninAllowed", guest_signin_allowed_); |
260 params.SetBoolean("offlineLoginAllowed", offline_login_allowed_); | 257 params.SetBoolean("offlineLoginAllowed", offline_login_allowed_); |
261 params.SetBoolean("showConnectingIndicator", show_connecting_indicator_); | 258 params.SetBoolean("showConnectingIndicator", show_connecting_indicator_); |
262 Show(parent_screen_, ¶ms); | 259 Show(parent_screen_, ¶ms); |
263 show_on_init_ = false; | 260 show_on_init_ = false; |
264 } | 261 } |
265 } | 262 } |
266 | 263 |
267 } // namespace chromeos | 264 } // namespace chromeos |
OLD | NEW |