| 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 */ var OptionsPage = options.OptionsPage; | 9 /** @const */ var OptionsPage = options.OptionsPage; |
| 10 /** @const */ var LanguageList = options.LanguageList; | 10 /** @const */ var LanguageList = options.LanguageList; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // Unhide the language button every time, as it could've been previously | 374 // Unhide the language button every time, as it could've been previously |
| 375 // hidden by a language change. | 375 // hidden by a language change. |
| 376 uiLanguageButton.hidden = false; | 376 uiLanguageButton.hidden = false; |
| 377 | 377 |
| 378 if (languageCode == templateData.prospectiveUiLanguageCode) { | 378 if (languageCode == templateData.prospectiveUiLanguageCode) { |
| 379 uiLanguageMessage.textContent = | 379 uiLanguageMessage.textContent = |
| 380 localStrings.getString('is_displayed_in_this_language'); | 380 localStrings.getString('is_displayed_in_this_language'); |
| 381 showMutuallyExclusiveNodes( | 381 showMutuallyExclusiveNodes( |
| 382 [uiLanguageButton, uiLanguageMessage, uiLanguageNotification], 1); | 382 [uiLanguageButton, uiLanguageMessage, uiLanguageNotification], 1); |
| 383 } else if (languageCode in templateData.uiLanguageCodeSet) { | 383 } else if (languageCode in templateData.uiLanguageCodeSet) { |
| 384 if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) { | 384 if (cr.isChromeOS && UIAccountTweaks.loggedInAsGuest()) { |
| 385 // In the guest mode for ChromeOS, changing UI language does not make | 385 // In the guest mode for ChromeOS, changing UI language does not make |
| 386 // sense because it does not take effect after browser restart. | 386 // sense because it does not take effect after browser restart. |
| 387 uiLanguageButton.hidden = true; | 387 uiLanguageButton.hidden = true; |
| 388 uiLanguageMessage.hidden = true; | 388 uiLanguageMessage.hidden = true; |
| 389 } else { | 389 } else { |
| 390 uiLanguageButton.textContent = | 390 uiLanguageButton.textContent = |
| 391 localStrings.getString('display_in_this_language'); | 391 localStrings.getString('display_in_this_language'); |
| 392 showMutuallyExclusiveNodes( | 392 showMutuallyExclusiveNodes( |
| 393 [uiLanguageButton, uiLanguageMessage, uiLanguageNotification], 0); | 393 [uiLanguageButton, uiLanguageMessage, uiLanguageNotification], 0); |
| 394 uiLanguageButton.onclick = function(e) { | 394 uiLanguageButton.onclick = function(e) { |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 // only take effect after restart. | 845 // only take effect after restart. |
| 846 showMutuallyExclusiveNodes([$('language-options-ui-language-button'), | 846 showMutuallyExclusiveNodes([$('language-options-ui-language-button'), |
| 847 $('language-options-ui-notification-bar')], 1); | 847 $('language-options-ui-notification-bar')], 1); |
| 848 }; | 848 }; |
| 849 | 849 |
| 850 // Export | 850 // Export |
| 851 return { | 851 return { |
| 852 LanguageOptions: LanguageOptions | 852 LanguageOptions: LanguageOptions |
| 853 }; | 853 }; |
| 854 }); | 854 }); |
| OLD | NEW |