| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 $('language-options-list').addLanguage(String(selection.value)); | 576 $('language-options-list').addLanguage(String(selection.value)); |
| 577 OptionsPage.closeOverlay(); | 577 OptionsPage.closeOverlay(); |
| 578 } | 578 } |
| 579 }, | 579 }, |
| 580 | 580 |
| 581 /** | 581 /** |
| 582 * Checks if languageCode is deletable or not. | 582 * Checks if languageCode is deletable or not. |
| 583 * @param {String} languageCode the languageCode to check for deletability. | 583 * @param {String} languageCode the languageCode to check for deletability. |
| 584 */ | 584 */ |
| 585 languageIsDeletable: function(languageCode) { | 585 languageIsDeletable: function(languageCode) { |
| 586 // Don't allow removing the language if it's as UI language. | 586 // Don't allow removing the language if it's a UI language. |
| 587 if (languageCode == templateData.prospectiveUiLanguageCode) | 587 if (languageCode == templateData.prospectiveUiLanguageCode) |
| 588 return false; | 588 return false; |
| 589 return (!cr.isChromeOS || | 589 return (!cr.isChromeOS || |
| 590 this.canDeleteLanguage_(languageCode)); | 590 this.canDeleteLanguage_(languageCode)); |
| 591 }, | 591 }, |
| 592 | 592 |
| 593 /** | 593 /** |
| 594 * Handles browse.enable_spellchecking change. | 594 * Handles browse.enable_spellchecking change. |
| 595 * @param {Event} e Change event. | 595 * @param {Event} e Change event. |
| 596 * @private | 596 * @private |
| (...skipping 248 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 |