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 |
*/ |