| 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-languages-page' is the settings page | 6 * @fileoverview 'settings-languages-page' is the settings page |
| 7 * for language and input method settings. | 7 * for language and input method settings. |
| 8 */ | 8 */ |
| 9 (function() { | 9 (function() { |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 * an existing instance of the IME's options). | 144 * an existing instance of the IME's options). |
| 145 * @param {!{model: !{item: chrome.languageSettingsPrivate.InputMethod}}} e | 145 * @param {!{model: !{item: chrome.languageSettingsPrivate.InputMethod}}} e |
| 146 * @private | 146 * @private |
| 147 */ | 147 */ |
| 148 onInputMethodOptionsTap_: function(e) { | 148 onInputMethodOptionsTap_: function(e) { |
| 149 assert(cr.isChromeOS); | 149 assert(cr.isChromeOS); |
| 150 this.languageHelper_.openInputMethodOptions(e.model.item.id); | 150 this.languageHelper_.openInputMethodOptions(e.model.item.id); |
| 151 }, | 151 }, |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * Returns the enabled languages which support spell check. | |
| 155 * @return {!Array<!LanguageState>} | |
| 156 * @private | |
| 157 */ | |
| 158 spellCheckLanguages_: function() { | |
| 159 assert(!cr.isMac); | |
| 160 return this.languages.enabled.filter(function(languageState) { | |
| 161 return languageState.language.supportsSpellcheck; | |
| 162 }); | |
| 163 }, | |
| 164 | |
| 165 /** | |
| 166 * Returns the secondary text for the spell check subsection based on the | 154 * Returns the secondary text for the spell check subsection based on the |
| 167 * enabled spell check languages, listing at most 2 languages. | 155 * enabled spell check languages, listing at most 2 languages. |
| 168 * @return {string} | 156 * @return {string} |
| 169 * @private | 157 * @private |
| 170 */ | 158 */ |
| 171 getSpellCheckSecondaryText_: function() { | 159 getSpellCheckSecondaryText_: function() { |
| 172 var enabledSpellCheckLanguages = | 160 var enabledSpellCheckLanguages = |
| 173 this.languages.enabled.filter(function(languageState) { | 161 this.languages.enabled.filter(function(languageState) { |
| 174 return languageState.spellCheckEnabled && | 162 return languageState.spellCheckEnabled && |
| 175 languageState.language.supportsSpellcheck; | 163 languageState.language.supportsSpellcheck; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 * HACK(michaelpg): This is necessary to show the list when navigating to | 274 * HACK(michaelpg): This is necessary to show the list when navigating to |
| 287 * the sub-page. Remove this function when PolymerElements/neon-animation#60 | 275 * the sub-page. Remove this function when PolymerElements/neon-animation#60 |
| 288 * is fixed. | 276 * is fixed. |
| 289 * @param {string} tagName Name of the element containing the <iron-list>. | 277 * @param {string} tagName Name of the element containing the <iron-list>. |
| 290 */ | 278 */ |
| 291 forceRenderList_: function(tagName) { | 279 forceRenderList_: function(tagName) { |
| 292 this.$$(tagName).$$('iron-list').fire('iron-resize'); | 280 this.$$(tagName).$$('iron-list').fire('iron-resize'); |
| 293 }, | 281 }, |
| 294 }); | 282 }); |
| 295 })(); | 283 })(); |
| OLD | NEW |