Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 398543002: Add language and keyboard layout pickers to public session pods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 21 matching lines...) Expand all
32 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 32 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
33 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" 33 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
34 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 34 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
35 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 35 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
36 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" 36 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
37 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" 37 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
38 #include "chrome/browser/chromeos/login/users/user.h" 38 #include "chrome/browser/chromeos/login/users/user.h"
39 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 39 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
40 #include "chrome/browser/chromeos/login/wizard_controller.h" 40 #include "chrome/browser/chromeos/login/wizard_controller.h"
41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
42 #include "chrome/browser/chromeos/policy/device_local_account.h"
42 #include "chrome/browser/chromeos/profiles/profile_helper.h" 43 #include "chrome/browser/chromeos/profiles/profile_helper.h"
43 #include "chrome/browser/chromeos/settings/cros_settings.h" 44 #include "chrome/browser/chromeos/settings/cros_settings.h"
44 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" 45 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h"
45 #include "chrome/browser/io_thread.h" 46 #include "chrome/browser/io_thread.h"
46 #include "chrome/browser/profiles/profile.h" 47 #include "chrome/browser/profiles/profile.h"
47 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" 48 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h"
48 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" 49 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h"
50 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
49 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" 51 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h"
50 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" 52 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h"
51 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 53 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
52 #include "chrome/common/pref_names.h" 54 #include "chrome/common/pref_names.h"
53 #include "chrome/common/url_constants.h" 55 #include "chrome/common/url_constants.h"
54 #include "chromeos/dbus/dbus_thread_manager.h" 56 #include "chromeos/dbus/dbus_thread_manager.h"
55 #include "chromeos/dbus/power_manager_client.h" 57 #include "chromeos/dbus/power_manager_client.h"
56 #include "chromeos/ime/ime_keyboard.h" 58 #include "chromeos/ime/ime_keyboard.h"
59 #include "chromeos/ime/input_method_descriptor.h"
57 #include "chromeos/ime/input_method_manager.h" 60 #include "chromeos/ime/input_method_manager.h"
58 #include "chromeos/login/auth/key.h" 61 #include "chromeos/login/auth/key.h"
59 #include "chromeos/login/auth/user_context.h" 62 #include "chromeos/login/auth/user_context.h"
60 #include "chromeos/network/network_state.h" 63 #include "chromeos/network/network_state.h"
61 #include "chromeos/network/network_state_handler.h" 64 #include "chromeos/network/network_state_handler.h"
62 #include "chromeos/network/portal_detector/network_portal_detector.h" 65 #include "chromeos/network/portal_detector/network_portal_detector.h"
63 #include "components/user_manager/user_type.h" 66 #include "components/user_manager/user_type.h"
64 #include "content/public/browser/render_frame_host.h" 67 #include "content/public/browser/render_frame_host.h"
65 #include "content/public/browser/web_contents.h" 68 #include "content/public/browser/web_contents.h"
66 #include "google_apis/gaia/gaia_auth_util.h" 69 #include "google_apis/gaia/gaia_auth_util.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 builder->Add("passwordChangedBackButton", 353 builder->Add("passwordChangedBackButton",
351 IDS_LOGIN_PASSWORD_CHANGED_BACK_BUTTON); 354 IDS_LOGIN_PASSWORD_CHANGED_BACK_BUTTON);
352 builder->Add("passwordChangedsOkButton", IDS_OK); 355 builder->Add("passwordChangedsOkButton", IDS_OK);
353 builder->Add("passwordChangedProceedAnyway", 356 builder->Add("passwordChangedProceedAnyway",
354 IDS_LOGIN_PASSWORD_CHANGED_PROCEED_ANYWAY); 357 IDS_LOGIN_PASSWORD_CHANGED_PROCEED_ANYWAY);
355 builder->Add("proceedAnywayButton", 358 builder->Add("proceedAnywayButton",
356 IDS_LOGIN_PASSWORD_CHANGED_PROCEED_ANYWAY_BUTTON); 359 IDS_LOGIN_PASSWORD_CHANGED_PROCEED_ANYWAY_BUTTON);
357 builder->Add("publicAccountInfoFormat", IDS_LOGIN_PUBLIC_ACCOUNT_INFO_FORMAT); 360 builder->Add("publicAccountInfoFormat", IDS_LOGIN_PUBLIC_ACCOUNT_INFO_FORMAT);
358 builder->Add("publicAccountReminder", 361 builder->Add("publicAccountReminder",
359 IDS_LOGIN_PUBLIC_ACCOUNT_SIGNOUT_REMINDER); 362 IDS_LOGIN_PUBLIC_ACCOUNT_SIGNOUT_REMINDER);
363 builder->Add("publicSessionLanguageAndInput",
364 IDS_LOGIN_PUBLIC_SESSION_LANGUAGE_AND_INPUT);
360 builder->Add("publicAccountEnter", IDS_LOGIN_PUBLIC_ACCOUNT_ENTER); 365 builder->Add("publicAccountEnter", IDS_LOGIN_PUBLIC_ACCOUNT_ENTER);
361 builder->Add("publicAccountEnterAccessibleName", 366 builder->Add("publicAccountEnterAccessibleName",
362 IDS_LOGIN_PUBLIC_ACCOUNT_ENTER_ACCESSIBLE_NAME); 367 IDS_LOGIN_PUBLIC_ACCOUNT_ENTER_ACCESSIBLE_NAME);
368 builder->Add("publicSessionSelectLanguage", IDS_LANGUAGE_SELECTION_SELECT);
369 builder->Add("publicSessionSelectKeyboard", IDS_KEYBOARD_SELECTION_SELECT);
363 builder->Add("removeUserWarningText", 370 builder->Add("removeUserWarningText",
364 base::string16()); 371 base::string16());
365 builder->AddF("removeSupervisedUserWarningText", 372 builder->AddF("removeSupervisedUserWarningText",
366 IDS_LOGIN_POD_SUPERVISED_USER_REMOVE_WARNING, 373 IDS_LOGIN_POD_SUPERVISED_USER_REMOVE_WARNING,
367 base::UTF8ToUTF16(chrome::kSupervisedUserManagementDisplayURL)); 374 base::UTF8ToUTF16(chrome::kSupervisedUserManagementDisplayURL));
368 builder->Add("removeUserWarningButtonTitle", 375 builder->Add("removeUserWarningButtonTitle",
369 IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON); 376 IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON);
370 377
371 builder->Add("samlNotice", IDS_LOGIN_SAML_NOTICE); 378 builder->Add("samlNotice", IDS_LOGIN_SAML_NOTICE);
372 379
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 &SigninScreenHandler::HandleLoginUIStateChanged); 715 &SigninScreenHandler::HandleLoginUIStateChanged);
709 AddCallback("unlockOnLoginSuccess", 716 AddCallback("unlockOnLoginSuccess",
710 &SigninScreenHandler::HandleUnlockOnLoginSuccess); 717 &SigninScreenHandler::HandleUnlockOnLoginSuccess);
711 AddCallback("showLoadingTimeoutError", 718 AddCallback("showLoadingTimeoutError",
712 &SigninScreenHandler::HandleShowLoadingTimeoutError); 719 &SigninScreenHandler::HandleShowLoadingTimeoutError);
713 AddCallback("updateOfflineLogin", 720 AddCallback("updateOfflineLogin",
714 &SigninScreenHandler::HandleUpdateOfflineLogin); 721 &SigninScreenHandler::HandleUpdateOfflineLogin);
715 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod); 722 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod);
716 AddCallback("retrieveAuthenticatedUserEmail", 723 AddCallback("retrieveAuthenticatedUserEmail",
717 &SigninScreenHandler::HandleRetrieveAuthenticatedUserEmail); 724 &SigninScreenHandler::HandleRetrieveAuthenticatedUserEmail);
725 AddCallback("getPublicSessionKeyboardLayouts",
726 &SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts);
727
718 728
719 // This message is sent by the kiosk app menu, but is handled here 729 // This message is sent by the kiosk app menu, but is handled here
720 // so we can tell the delegate to launch the app. 730 // so we can tell the delegate to launch the app.
721 AddCallback("launchKioskApp", &SigninScreenHandler::HandleLaunchKioskApp); 731 AddCallback("launchKioskApp", &SigninScreenHandler::HandleLaunchKioskApp);
722 } 732 }
723 733
724 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) { 734 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) {
725 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod); 735 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod);
726 } 736 }
727 737
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 double attempt_token) { 1254 double attempt_token) {
1245 // TODO(antrim) : move GaiaSigninScreen dependency to GaiaSigninScreen. 1255 // TODO(antrim) : move GaiaSigninScreen dependency to GaiaSigninScreen.
1246 email_retriever_.reset(new AuthenticatedUserEmailRetriever( 1256 email_retriever_.reset(new AuthenticatedUserEmailRetriever(
1247 base::Bind(&SigninScreenHandler::CallJS<double, std::string>, 1257 base::Bind(&SigninScreenHandler::CallJS<double, std::string>,
1248 base::Unretained(this), 1258 base::Unretained(this),
1249 "login.GaiaSigninScreen.setAuthenticatedUserEmail", 1259 "login.GaiaSigninScreen.setAuthenticatedUserEmail",
1250 attempt_token), 1260 attempt_token),
1251 Profile::FromWebUI(web_ui())->GetRequestContext())); 1261 Profile::FromWebUI(web_ui())->GetRequestContext()));
1252 } 1262 }
1253 1263
1264 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts(
1265 const std::string& user_id,
1266 const std::string& locale) {
1267 web_ui()->CallJavascriptFunction(
1268 "login.AccountPickerScreen.setPublicSessionKeyboardLayouts",
1269 base::StringValue(user_id),
1270 *GetKeyboardLayouts(locale).release());
1271 }
1272
1254 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id, 1273 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id,
1255 bool diagnostic_mode) { 1274 bool diagnostic_mode) {
1256 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id); 1275 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id);
1257 SigninSpecifics specifics; 1276 SigninSpecifics specifics;
1258 specifics.kiosk_diagnostic_mode = diagnostic_mode; 1277 specifics.kiosk_diagnostic_mode = diagnostic_mode;
1259 if (delegate_) 1278 if (delegate_)
1260 delegate_->Login(context, specifics); 1279 delegate_->Login(context, specifics);
1261 } 1280 }
1262 1281
1263 bool SigninScreenHandler::AllWhitelistedUsersPresent() { 1282 bool SigninScreenHandler::AllWhitelistedUsersPresent() {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 return gaia_screen_handler_->frame_error(); 1397 return gaia_screen_handler_->frame_error();
1379 } 1398 }
1380 1399
1381 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { 1400 void SigninScreenHandler::OnCapsLockChanged(bool enabled) {
1382 caps_lock_enabled_ = enabled; 1401 caps_lock_enabled_ = enabled;
1383 if (page_is_ready()) 1402 if (page_is_ready())
1384 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); 1403 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_);
1385 } 1404 }
1386 1405
1387 } // namespace chromeos 1406 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698