| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview 'settings-edit-dictionary-page' is a sub-page for editing | 6 * @fileoverview 'settings-edit-dictionary-page' is a sub-page for editing |
| 7 * the "dictionary" of custom words used for spell check. | 7 * the "dictionary" of custom words used for spell check. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-edit-dictionary-page', | 10 is: 'settings-edit-dictionary-page', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 /** @type {LanguageSettingsPrivate} */ | 36 /** @type {LanguageSettingsPrivate} */ |
| 37 languageSettingsPrivate: null, | 37 languageSettingsPrivate: null, |
| 38 | 38 |
| 39 /** @override */ | 39 /** @override */ |
| 40 ready: function() { | 40 ready: function() { |
| 41 this.languageSettingsPrivate = settings.languageSettingsPrivateApiForTest || | 41 this.languageSettingsPrivate = settings.languageSettingsPrivateApiForTest || |
| 42 /** @type {!LanguageSettingsPrivate} */ | 42 /** @type {!LanguageSettingsPrivate} */ |
| 43 (chrome.languageSettingsPrivate); | 43 (chrome.languageSettingsPrivate); |
| 44 | 44 |
| 45 this.languageSettingsPrivate.getSpellcheckWords(function(words) { | 45 this.languageSettingsPrivate.getSpellcheckWords(words => { |
| 46 this.words_ = words; | 46 this.words_ = words; |
| 47 }.bind(this)); | 47 }); |
| 48 | 48 |
| 49 this.languageSettingsPrivate.onCustomDictionaryChanged.addListener( | 49 this.languageSettingsPrivate.onCustomDictionaryChanged.addListener( |
| 50 this.onCustomDictionaryChanged_.bind(this)); | 50 this.onCustomDictionaryChanged_.bind(this)); |
| 51 | 51 |
| 52 // Add a key handler for the paper-input. | 52 // Add a key handler for the paper-input. |
| 53 this.$.keys.target = this.$.newWord; | 53 this.$.keys.target = this.$.newWord; |
| 54 }, | 54 }, |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Check if the new word text-field is empty. | 57 * Check if the new word text-field is empty. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * Checks if any words exists in the dictionary. | 138 * Checks if any words exists in the dictionary. |
| 139 * @private | 139 * @private |
| 140 * @return {boolean} | 140 * @return {boolean} |
| 141 */ | 141 */ |
| 142 hasWords_: function() { | 142 hasWords_: function() { |
| 143 return this.words_.length > 0; | 143 return this.words_.length > 0; |
| 144 } | 144 } |
| 145 }); | 145 }); |
| OLD | NEW |