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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 /** | 623 /** |
624 * Handles spellCheckLanguageButton click. | 624 * Handles spellCheckLanguageButton click. |
625 * @param {Event} e Click event. | 625 * @param {Event} e Click event. |
626 * @private | 626 * @private |
627 */ | 627 */ |
628 handleSpellCheckLanguageButtonClick_: function(e) { | 628 handleSpellCheckLanguageButtonClick_: function(e) { |
629 var languageCode = e.target.languageCode; | 629 var languageCode = e.target.languageCode; |
630 // Save the preference. | 630 // Save the preference. |
631 Preferences.setStringPref(this.spellCheckDictionaryPref, | 631 Preferences.setStringPref(this.spellCheckDictionaryPref, |
632 languageCode); | 632 languageCode, true); |
633 chrome.send('spellCheckLanguageChange', [languageCode]); | 633 chrome.send('spellCheckLanguageChange', [languageCode]); |
634 }, | 634 }, |
635 | 635 |
636 /** | 636 /** |
637 * Checks whether it's possible to remove the language specified by | 637 * Checks whether it's possible to remove the language specified by |
638 * languageCode and returns true if possible. This function returns false | 638 * languageCode and returns true if possible. This function returns false |
639 * if the removal causes the number of preload engines to be zero. | 639 * if the removal causes the number of preload engines to be zero. |
640 * | 640 * |
641 * @param {string} languageCode Language code (ex. "fr"). | 641 * @param {string} languageCode Language code (ex. "fr"). |
642 * @return {boolean} Returns true on success. | 642 * @return {boolean} Returns true on success. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // engines to be zero. | 683 // engines to be zero. |
684 return (newPreloadEngines.length > 0); | 684 return (newPreloadEngines.length > 0); |
685 }, | 685 }, |
686 | 686 |
687 /** | 687 /** |
688 * Saves the preload engines preference. | 688 * Saves the preload engines preference. |
689 * @private | 689 * @private |
690 */ | 690 */ |
691 savePreloadEnginesPref_: function() { | 691 savePreloadEnginesPref_: function() { |
692 Preferences.setStringPref(this.preloadEnginesPref, | 692 Preferences.setStringPref(this.preloadEnginesPref, |
693 this.preloadEngines_.join(',')); | 693 this.preloadEngines_.join(','), true); |
694 }, | 694 }, |
695 | 695 |
696 /** | 696 /** |
697 * Updates the checkboxes in the input method list from the preload | 697 * Updates the checkboxes in the input method list from the preload |
698 * engines preference. | 698 * engines preference. |
699 * @private | 699 * @private |
700 */ | 700 */ |
701 updateCheckboxesFromPreloadEngines_: function() { | 701 updateCheckboxesFromPreloadEngines_: function() { |
702 // Convert the list into a dictonary for simpler lookup. | 702 // Convert the list into a dictonary for simpler lookup. |
703 var dictionary = {}; | 703 var dictionary = {}; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 // only take effect after restart. | 851 // only take effect after restart. |
852 showMutuallyExclusiveNodes([$('language-options-ui-language-button'), | 852 showMutuallyExclusiveNodes([$('language-options-ui-language-button'), |
853 $('language-options-ui-notification-bar')], 1); | 853 $('language-options-ui-notification-bar')], 1); |
854 }; | 854 }; |
855 | 855 |
856 // Export | 856 // Export |
857 return { | 857 return { |
858 LanguageOptions: LanguageOptions | 858 LanguageOptions: LanguageOptions |
859 }; | 859 }; |
860 }); | 860 }); |
OLD | NEW |