| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(kochi): Generalize the notification as a component and put it | 5 // TODO(kochi): Generalize the notification as a component and put it |
| 6 // in js/cr/ui/notification.js . | 6 // in js/cr/ui/notification.js . |
| 7 | 7 |
| 8 cr.define('options', function() { | 8 cr.define('options', function() { |
| 9 const OptionsPage = options.OptionsPage; | 9 const OptionsPage = options.OptionsPage; |
| 10 const LanguageList = options.LanguageList; | 10 const LanguageList = options.LanguageList; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // currently in use. | 354 // currently in use. |
| 355 uiLanguageButton.textContent = | 355 uiLanguageButton.textContent = |
| 356 localStrings.getString('is_displayed_in_this_language'); | 356 localStrings.getString('is_displayed_in_this_language'); |
| 357 // Make it look like a text label. | 357 // Make it look like a text label. |
| 358 uiLanguageButton.className = 'text-button'; | 358 uiLanguageButton.className = 'text-button'; |
| 359 // Remove the event listner. | 359 // Remove the event listner. |
| 360 uiLanguageButton.onclick = undefined; | 360 uiLanguageButton.onclick = undefined; |
| 361 } else if (languageCode in templateData.uiLanguageCodeSet) { | 361 } else if (languageCode in templateData.uiLanguageCodeSet) { |
| 362 // If the language is supported as UI language, users can click on | 362 // If the language is supported as UI language, users can click on |
| 363 // the button to change the UI language. | 363 // the button to change the UI language. |
| 364 if (cr.commandLine && cr.commandLine.options['--bwsi']) { | 364 if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) { |
| 365 // In the guest mode for ChromeOS, changing UI language does not make | 365 // In the guest mode for ChromeOS, changing UI language does not make |
| 366 // sense because it does not take effect after browser restart. | 366 // sense because it does not take effect after browser restart. |
| 367 uiLanguageButton.hidden = true; | 367 uiLanguageButton.hidden = true; |
| 368 } else { | 368 } else { |
| 369 uiLanguageButton.textContent = | 369 uiLanguageButton.textContent = |
| 370 localStrings.getString('display_in_this_language'); | 370 localStrings.getString('display_in_this_language'); |
| 371 uiLanguageButton.className = ''; | 371 uiLanguageButton.className = ''; |
| 372 // Send the change request to Chrome. | 372 // Send the change request to Chrome. |
| 373 uiLanguageButton.onclick = function(e) { | 373 uiLanguageButton.onclick = function(e) { |
| 374 chrome.send('uiLanguageChange', [languageCode]); | 374 chrome.send('uiLanguageChange', [languageCode]); |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 LanguageOptions.uiLanguageSaved = function() { | 813 LanguageOptions.uiLanguageSaved = function() { |
| 814 $('language-options-ui-language-button').style.display = 'none'; | 814 $('language-options-ui-language-button').style.display = 'none'; |
| 815 $('language-options-ui-notification-bar').style.display = 'block'; | 815 $('language-options-ui-notification-bar').style.display = 'block'; |
| 816 }; | 816 }; |
| 817 | 817 |
| 818 // Export | 818 // Export |
| 819 return { | 819 return { |
| 820 LanguageOptions: LanguageOptions | 820 LanguageOptions: LanguageOptions |
| 821 }; | 821 }; |
| 822 }); | 822 }); |
| OLD | NEW |