| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 | 6 |
| 7 const OptionsPage = options.OptionsPage; | 7 const OptionsPage = options.OptionsPage; |
| 8 const AddLanguageOverlay = options.language.AddLanguageOverlay; | 8 const AddLanguageOverlay = options.language.AddLanguageOverlay; |
| 9 const LanguageList = options.language.LanguageList; | 9 const LanguageList = options.language.LanguageList; |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 */ | 106 */ |
| 107 handleLanguageOptionsListChange_: function(e) { | 107 handleLanguageOptionsListChange_: function(e) { |
| 108 var languageOptionsList = $('language-options-list'); | 108 var languageOptionsList = $('language-options-list'); |
| 109 var index = languageOptionsList.selectionModel.selectedIndex; | 109 var index = languageOptionsList.selectionModel.selectedIndex; |
| 110 if (index == -1) | 110 if (index == -1) |
| 111 return; | 111 return; |
| 112 | 112 |
| 113 var languageCode = languageOptionsList.getLanguageCodes()[index]; | 113 var languageCode = languageOptionsList.getLanguageCodes()[index]; |
| 114 this.updateSelectedLanguageName_(languageCode); | 114 this.updateSelectedLanguageName_(languageCode); |
| 115 this.updateUiLanguageButton_(languageCode); | 115 this.updateUiLanguageButton_(languageCode); |
| 116 this.updateInputMethodList_(); | 116 this.updateInputMethodList_(languageCode); |
| 117 this.updateLanguageListInAddLanguageOverlay_(); | 117 this.updateLanguageListInAddLanguageOverlay_(); |
| 118 }, | 118 }, |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Updates the currently selected language name. | 121 * Updates the currently selected language name. |
| 122 * @param {string} languageCode Language code (ex. "fr"). | 122 * @param {string} languageCode Language code (ex. "fr"). |
| 123 * @private | 123 * @private |
| 124 */ | 124 */ |
| 125 updateSelectedLanguageName_: function(languageCode) { | 125 updateSelectedLanguageName_: function(languageCode) { |
| 126 var languageDisplayName = LanguageList.getDisplayNameFromLanguageCode( | 126 var languageDisplayName = LanguageList.getDisplayNameFromLanguageCode( |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // from UX. | 351 // from UX. |
| 352 alert(localStrings.getString('restart_required')); | 352 alert(localStrings.getString('restart_required')); |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 // Export | 355 // Export |
| 356 return { | 356 return { |
| 357 LanguageOptions: LanguageOptions | 357 LanguageOptions: LanguageOptions |
| 358 }; | 358 }; |
| 359 | 359 |
| 360 }); | 360 }); |
| OLD | NEW |