Chromium Code Reviews| Index: chrome/browser/resources/options2/language_options.js |
| diff --git a/chrome/browser/resources/options2/language_options.js b/chrome/browser/resources/options2/language_options.js |
| index fa6067e9a796dba4acf73a0abcc817a6a0ffb635..a528fc71e2e53f728d11e10c33a5b086c084b29e 100644 |
| --- a/chrome/browser/resources/options2/language_options.js |
| +++ b/chrome/browser/resources/options2/language_options.js |
| @@ -40,9 +40,15 @@ cr.define('options', function() { |
| LanguageOptions.prototype = { |
| __proto__: OptionsPage.prototype, |
| + /* For recording the prospective language (the next locale after relaunch). |
| + * @type {?string} |
| + * @private |
| + */ |
| + prospectiveUiLanguageCode_: null, |
| + |
| /** |
| * Initializes LanguageOptions page. |
| - * Calls base class implementation to starts preference initialization. |
| + * Calls base class implementation to start preference initialization. |
| */ |
| initializePage: function() { |
| OptionsPage.prototype.initializePage.call(this); |
| @@ -55,6 +61,8 @@ cr.define('options', function() { |
| languageOptionsList.addEventListener('save', |
| this.handleLanguageOptionsListSave_.bind(this)); |
| + this.prospectiveUiLanguageCode_ = |
| + loadTimeData.getString('prospectiveUiLanguageCode'); |
| this.addEventListener('visibleChange', |
| this.handleVisibleChange_.bind(this)); |
| @@ -113,7 +121,7 @@ cr.define('options', function() { |
| if (cr.isChromeOS) { |
| $('language-options-ui-restart-button').onclick = |
| - chrome.send.bind(chrome, 'uiLanguageRestart'); |
| + chrome.send('uiLanguageRestart'); |
|
Dan Beam
2012/06/12 01:28:28
this calls the function, doesn't return a referenc
kochi
2012/06/12 06:02:25
Oh, I hope I understand you this time:)
When I tr
|
| } |
| $('language-confirm').onclick = |
| @@ -370,7 +378,7 @@ cr.define('options', function() { |
| // hidden by a language change. |
| uiLanguageButton.hidden = false; |
| - if (languageCode == loadTimeData.getString('prospectiveUiLanguageCode')) { |
| + if (languageCode == this.prospectiveUiLanguageCode_) { |
| uiLanguageMessage.textContent = |
| loadTimeData.getString('is_displayed_in_this_language'); |
| showMutuallyExclusiveNodes( |
| @@ -580,7 +588,7 @@ cr.define('options', function() { |
| */ |
| languageIsDeletable: function(languageCode) { |
| // Don't allow removing the language if it's a UI language. |
| - if (languageCode == loadTimeData.getString('prospectiveUiLanguageCode')) |
| + if (languageCode == this.prospectiveUiLanguageCode_) |
| return false; |
| return (!cr.isChromeOS || |
| this.canDeleteLanguage_(languageCode)); |
| @@ -824,7 +832,7 @@ cr.define('options', function() { |
| * @param {string} languageCode The newly selected language to use. |
| */ |
| LanguageOptions.uiLanguageSaved = function(languageCode) { |
| - loadTimeData.getString('prospectiveUiLanguageCode') = languageCode; |
| + this.prospectiveUiLanguageCode_ = languageCode; |
| // If the user is no longer on the same language code, ignore. |
| if ($('language-options-list').getSelectedLanguageCode() != languageCode) |