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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 417103003: Retrieve the list of keyboard layouts for public sessions async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use blocking pool instead of FILE thread. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index fe0d12a5e6bc1190055eeb1236c9da38ed0acf97..684039ded158a373b8b0748d010eac324b486812 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -1054,12 +1054,9 @@ cr.define('login', function() {
var languageSelect = this.querySelector('.language-select');
languageSelect.tabIndex = UserPodTabOrder.POD_INPUT;
- languageSelect.addEventListener('change', function() {
- chrome.send('getPublicSessionKeyboardLayouts', [
- this.user.username,
- languageSelect.options[languageSelect.selectedIndex].value]);
- }.bind(this));
-
+ languageSelect.addEventListener(
+ 'change',
+ this.getPublicSessionKeyboardLayouts_.bind(this));
this.querySelector('.keyboard-select').tabIndex =
UserPodTabOrder.POD_INPUT;
@@ -1100,7 +1097,8 @@ cr.define('login', function() {
id = this.user.username + '-keyboard';
this.querySelector('.keyboard-select-label').htmlFor = id;
this.querySelector('.keyboard-select').setAttribute('id', id);
- this.populateKeyboardSelect_(this.user.initialKeyboardLayouts);
+ this.populateKeyboardSelect_([this.user.initialKeyboardLayout]);
+ this.getPublicSessionKeyboardLayouts_();
},
/** @override **/
@@ -1212,6 +1210,17 @@ cr.define('login', function() {
},
/**
+ * Retrieves the list of keyboard layouts available for the currently
+ * selected locale.
+ */
+ getPublicSessionKeyboardLayouts_: function() {
+ var languageSelect = this.querySelector('.language-select');
+ chrome.send('getPublicSessionKeyboardLayouts', [
+ this.user.username,
+ languageSelect.options[languageSelect.selectedIndex].value]);
+ },
+
+ /**
* Populates the keyboard layout "select" element with a list of layouts.
* @param {!Object} list List of available keyboard layouts
*/
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698