Chromium Code Reviews| Index: chrome/browser/resources/options/language_options.js |
| diff --git a/chrome/browser/resources/options/language_options.js b/chrome/browser/resources/options/language_options.js |
| index e93b48525f39d42fc1e5c6a3c1a97af609b0155b..29f86059ca2947b882a46991e775fb841c0de61b 100644 |
| --- a/chrome/browser/resources/options/language_options.js |
| +++ b/chrome/browser/resources/options/language_options.js |
| @@ -385,6 +385,8 @@ cr.define('options', function() { |
| var languageCode = languageCodes[i]; |
| var inputMethodIds = this.languageCodeToInputMethodIdsMap_[ |
| languageCode]; |
| + if (!inputMethodIds) |
| + continue; |
|
James Hawkins
2013/04/05 18:41:50
Optional nit: Add a blank line below this to incre
Zachary Kuznia
2013/04/09 06:45:52
Done.
|
| // Check if we have active input methods associated with the language. |
| for (var j = 0; j < inputMethodIds.length; j++) { |
| var inputMethodId = inputMethodIds[j]; |
| @@ -579,6 +581,9 @@ cr.define('options', function() { |
| } |
| } |
| + $('language-options-input-method-none').hidden = |
| + (languageCode in this.languageCodeToInputMethodIdsMap_); |
| + |
| if (focusInputMethodId == 'add') { |
| $('language-options-add-button').focus(); |
| } |
| @@ -798,6 +803,11 @@ cr.define('options', function() { |
| // associated with the language code. |
| var enginesToBeRemovedSet = {}; |
| var inputMethodIds = this.languageCodeToInputMethodIdsMap_[languageCode]; |
| + |
| + // If this language doesn't have any input methods, it can be deleted. |
| + if (!inputMethodIds) |
| + return true; |
| + |
| for (var i = 0; i < inputMethodIds.length; i++) { |
| enginesToBeRemovedSet[inputMethodIds[i]] = true; |
| } |
| @@ -815,6 +825,8 @@ cr.define('options', function() { |
| // we don't remove this time. |
| var inputMethodIdsForAnotherLanguage = |
| this.languageCodeToInputMethodIdsMap_[languageCodes[i]]; |
| + if (!inputMethodIdsForAnotherLanguage) |
| + continue; |
|
James Hawkins
2013/04/05 18:41:50
Optional nit: Add a blank line below this to incre
Zachary Kuznia
2013/04/09 06:45:52
Done.
|
| for (var j = 0; j < inputMethodIdsForAnotherLanguage.length; j++) { |
| var inputMethodId = inputMethodIdsForAnotherLanguage[j]; |
| if (inputMethodId in enginesToBeRemovedSet) { |