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 cr.exportPath('settings'); | 9 cr.exportPath('settings'); |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 /** @private */ | 61 /** @private */ |
62 showAddLanguagesDialog_: Boolean, | 62 showAddLanguagesDialog_: Boolean, |
63 | 63 |
64 /** @private {!Map<string, string>} */ | 64 /** @private {!Map<string, string>} */ |
65 focusConfig_: { | 65 focusConfig_: { |
66 type: Object, | 66 type: Object, |
67 value: function() { | 67 value: function() { |
68 var map = new Map(); | 68 var map = new Map(); |
69 // <if expr="not is_macosx"> | 69 // <if expr="not is_macosx"> |
70 map.set( | 70 if (settings.routes.EDIT_DICTIONARY) { |
71 settings.Route.EDIT_DICTIONARY.path, | 71 map.set( |
72 '#spellCheckCollapse .subpage-arrow'); | 72 settings.routes.EDIT_DICTIONARY.path, |
| 73 '#spellCheckCollapse .subpage-arrow'); |
| 74 } |
73 // </if> | 75 // </if> |
74 // <if expr="chromeos"> | 76 // <if expr="chromeos"> |
75 map.set( | 77 if (settings.routes.INPUT_METHODS) { |
76 settings.Route.INPUT_METHODS.path, | 78 map.set( |
77 '#inputMethodsCollapse .subpage-arrow'); | 79 settings.routes.INPUT_METHODS.path, |
| 80 '#inputMethodsCollapse .subpage-arrow'); |
| 81 } |
78 // </if> | 82 // </if> |
79 return map; | 83 return map; |
80 }, | 84 }, |
81 }, | 85 }, |
82 }, | 86 }, |
83 | 87 |
84 /** | 88 /** |
85 * Stamps and opens the Add Languages dialog, registering a listener to | 89 * Stamps and opens the Add Languages dialog, registering a listener to |
86 * disable the dialog's dom-if again on close. | 90 * disable the dialog's dom-if again on close. |
87 * @param {!Event} e | 91 * @param {!Event} e |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 uiAccountTweaks.UIAccountTweaks.loggedInAsPublicAccount()) { | 166 uiAccountTweaks.UIAccountTweaks.loggedInAsPublicAccount()) { |
163 menu.querySelector('#uiLanguageItem').hidden = true; | 167 menu.querySelector('#uiLanguageItem').hidden = true; |
164 } | 168 } |
165 }, | 169 }, |
166 | 170 |
167 /** | 171 /** |
168 * Opens the Manage Input Methods page. | 172 * Opens the Manage Input Methods page. |
169 * @private | 173 * @private |
170 */ | 174 */ |
171 onManageInputMethodsTap_: function() { | 175 onManageInputMethodsTap_: function() { |
172 settings.navigateTo(settings.Route.INPUT_METHODS); | 176 settings.navigateTo(settings.routes.INPUT_METHODS); |
173 }, | 177 }, |
174 | 178 |
175 /** | 179 /** |
176 * Handler for tap and <Enter> events on an input method on the main page, | 180 * Handler for tap and <Enter> events on an input method on the main page, |
177 * which sets it as the current input method. | 181 * which sets it as the current input method. |
178 * @param {!{model: !{item: !chrome.languageSettingsPrivate.InputMethod}, | 182 * @param {!{model: !{item: !chrome.languageSettingsPrivate.InputMethod}, |
179 * target: !{tagName: string}, | 183 * target: !{tagName: string}, |
180 * type: string, | 184 * type: string, |
181 * key: (string|undefined)}} e | 185 * key: (string|undefined)}} e |
182 */ | 186 */ |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 enabledSpellCheckLanguages[1].language.displayName, | 418 enabledSpellCheckLanguages[1].language.displayName, |
415 (enabledSpellCheckLanguages.length - 2).toLocaleString()); | 419 (enabledSpellCheckLanguages.length - 2).toLocaleString()); |
416 } | 420 } |
417 }, | 421 }, |
418 | 422 |
419 /** | 423 /** |
420 * Opens the Custom Dictionary page. | 424 * Opens the Custom Dictionary page. |
421 * @private | 425 * @private |
422 */ | 426 */ |
423 onEditDictionaryTap_: function() { | 427 onEditDictionaryTap_: function() { |
424 settings.navigateTo(settings.Route.EDIT_DICTIONARY); | 428 settings.navigateTo(settings.routes.EDIT_DICTIONARY); |
425 }, | 429 }, |
426 | 430 |
427 /** | 431 /** |
428 * Handler for enabling or disabling spell check. | 432 * Handler for enabling or disabling spell check. |
429 * @param {!{target: Element, model: !{item: !LanguageState}}} e | 433 * @param {!{target: Element, model: !{item: !LanguageState}}} e |
430 */ | 434 */ |
431 onSpellCheckChange_: function(e) { | 435 onSpellCheckChange_: function(e) { |
432 var item = e.model.item; | 436 var item = e.model.item; |
433 if (!item.language.supportsSpellcheck) | 437 if (!item.language.supportsSpellcheck) |
434 return; | 438 return; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 if (e.target.tagName == expandButtonTag) | 562 if (e.target.tagName == expandButtonTag) |
559 return; | 563 return; |
560 | 564 |
561 /** @type {!CrExpandButtonElement} */ | 565 /** @type {!CrExpandButtonElement} */ |
562 var expandButton = e.currentTarget.querySelector(expandButtonTag); | 566 var expandButton = e.currentTarget.querySelector(expandButtonTag); |
563 assert(expandButton); | 567 assert(expandButton); |
564 expandButton.expanded = !expandButton.expanded; | 568 expandButton.expanded = !expandButton.expanded; |
565 }, | 569 }, |
566 }); | 570 }); |
567 })(); | 571 })(); |
OLD | NEW |