Chromium Code Reviews| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 } | 343 } |
| 344 }, | 344 }, |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Opens the Custom Dictionary page. | 347 * Opens the Custom Dictionary page. |
| 348 * @private | 348 * @private |
| 349 */ | 349 */ |
| 350 onEditDictionaryTap_: function() { | 350 onEditDictionaryTap_: function() { |
| 351 assert(!cr.isMac); | 351 assert(!cr.isMac); |
| 352 settings.navigateTo(settings.Route.EDIT_DICTIONARY); | 352 settings.navigateTo(settings.Route.EDIT_DICTIONARY); |
| 353 this.forceRenderList_('settings-edit-dictionary-page'); | |
| 354 }, | 353 }, |
| 355 | 354 |
| 356 /** | 355 /** |
| 357 * Checks whether the prospective UI language (the pref that indicates what | 356 * Checks whether the prospective UI language (the pref that indicates what |
| 358 * language to use in Chrome) matches the current language. This pref is used | 357 * language to use in Chrome) matches the current language. This pref is used |
| 359 * only on Chrome OS and Windows; we don't control the UI language elsewhere. | 358 * only on Chrome OS and Windows; we don't control the UI language elsewhere. |
| 360 * @param {string} languageCode The language code identifying a language. | 359 * @param {string} languageCode The language code identifying a language. |
| 361 * @param {string} prospectiveUILanguage The prospective UI language. | 360 * @param {string} prospectiveUILanguage The prospective UI language. |
| 362 * @return {boolean} True if the given language matches the prospective UI | 361 * @return {boolean} True if the given language matches the prospective UI |
| 363 * pref (which may be different from the actual UI language). | 362 * pref (which may be different from the actual UI language). |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 getInputMethodName_: function(id) { | 448 getInputMethodName_: function(id) { |
| 450 assert(cr.isChromeOS); | 449 assert(cr.isChromeOS); |
| 451 var inputMethod = this.languages.inputMethods.enabled.find( | 450 var inputMethod = this.languages.inputMethods.enabled.find( |
| 452 function(inputMethod) { | 451 function(inputMethod) { |
| 453 return inputMethod.id == id; | 452 return inputMethod.id == id; |
| 454 }); | 453 }); |
| 455 return inputMethod ? inputMethod.displayName : ''; | 454 return inputMethod ? inputMethod.displayName : ''; |
| 456 }, | 455 }, |
| 457 | 456 |
| 458 /** | 457 /** |
| 459 * HACK(michaelpg): This is necessary to show the list when navigating to | |
| 460 * the sub-page. Remove this function when PolymerElements/neon-animation#60 | |
| 461 * is fixed. | |
| 462 * @param {string} tagName Name of the element containing the <iron-list>. | |
| 463 */ | |
|
scottchen
2017/02/15 19:34:46
This is fixed now so we can remove it.
dpapad
2017/02/15 20:36:37
Can you elaborate how you verified that this works
scottchen
2017/02/22 21:42:25
michaelpg@ says the iron list used to not show up
| |
| 464 forceRenderList_: function(tagName) { | |
| 465 this.$$(tagName).$$('iron-list').fire('iron-resize'); | |
| 466 }, | |
| 467 | |
| 468 /** | |
| 469 * @param {!Event} e | 458 * @param {!Event} e |
| 470 * @private | 459 * @private |
| 471 */ | 460 */ |
| 472 onDotsTap_: function(e) { | 461 onDotsTap_: function(e) { |
| 473 // Set a copy of the LanguageState object since it is not data-bound to the | 462 // Set a copy of the LanguageState object since it is not data-bound to the |
| 474 // languages model directly. | 463 // languages model directly. |
| 475 this.detailLanguage_ = /** @type {!LanguageState} */(Object.assign( | 464 this.detailLanguage_ = /** @type {!LanguageState} */(Object.assign( |
| 476 {}, | 465 {}, |
| 477 /** @type {!{model: !{item: !LanguageState}}} */(e).model.item)); | 466 /** @type {!{model: !{item: !LanguageState}}} */(e).model.item)); |
| 478 | 467 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 if (e.target.tagName == expandButtonTag) | 533 if (e.target.tagName == expandButtonTag) |
| 545 return; | 534 return; |
| 546 | 535 |
| 547 /** @type {!CrExpandButtonElement} */ | 536 /** @type {!CrExpandButtonElement} */ |
| 548 var expandButton = e.currentTarget.querySelector(expandButtonTag); | 537 var expandButton = e.currentTarget.querySelector(expandButtonTag); |
| 549 assert(expandButton); | 538 assert(expandButton); |
| 550 expandButton.expanded = !expandButton.expanded; | 539 expandButton.expanded = !expandButton.expanded; |
| 551 }, | 540 }, |
| 552 }); | 541 }); |
| 553 })(); | 542 })(); |
| OLD | NEW |