| 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..37251356929bed6ad66d995bb01202f9b3450188 100644
|
| --- a/chrome/browser/resources/options/language_options.js
|
| +++ b/chrome/browser/resources/options/language_options.js
|
| @@ -385,6 +385,9 @@ cr.define('options', function() {
|
| var languageCode = languageCodes[i];
|
| var inputMethodIds = this.languageCodeToInputMethodIdsMap_[
|
| languageCode];
|
| + if (!inputMethodIds)
|
| + continue;
|
| +
|
| // 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 +582,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 +804,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 +826,9 @@ cr.define('options', function() {
|
| // we don't remove this time.
|
| var inputMethodIdsForAnotherLanguage =
|
| this.languageCodeToInputMethodIdsMap_[languageCodes[i]];
|
| + if (!inputMethodIdsForAnotherLanguage)
|
| + continue;
|
| +
|
| for (var j = 0; j < inputMethodIdsForAnotherLanguage.length; j++) {
|
| var inputMethodId = inputMethodIdsForAnotherLanguage[j];
|
| if (inputMethodId in enginesToBeRemovedSet) {
|
|
|