Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/resources/settings/languages_page/languages_page.js

Issue 2541513007: Language settings: change spellcheck row; minor code cleanup (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 */ 28 */
29 languages: { 29 languages: {
30 type: Object, 30 type: Object,
31 notify: true, 31 notify: true,
32 }, 32 },
33 33
34 /** @type {!LanguageHelper} */ 34 /** @type {!LanguageHelper} */
35 languageHelper: Object, 35 languageHelper: Object,
36 36
37 /** @private */ 37 /** @private */
38 spellCheckSecondary_: { 38 spellCheckSecondaryText_: {
39 type: String, 39 type: String,
40 value: 'Placeholder, e.g. English (United States)', 40 value: '',
41 computed: 'getSpellCheckSecondaryText_(languages.enabled.*)',
41 }, 42 },
42 43
43 /** 44 /**
44 * The language to display the details for. 45 * The language to display the details for.
45 * @type {!LanguageState|undefined} 46 * @type {!LanguageState|undefined}
46 * @private 47 * @private
47 */ 48 */
48 detailLanguage_: Object, 49 detailLanguage_: Object,
49 50
50 /** @private */ 51 /** @private */
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 370
370 /** 371 /**
371 * @return {string} 372 * @return {string}
372 * @private 373 * @private
373 */ 374 */
374 getLanguageListTwoLine_: function() { 375 getLanguageListTwoLine_: function() {
375 return cr.isChromeOS || cr.isWindows ? 'two-line' : ''; 376 return cr.isChromeOS || cr.isWindows ? 'two-line' : '';
376 }, 377 },
377 378
378 /** 379 /**
380 * @return {string}
381 * @private
382 */
383 getSpellCheckListTwoLine_: function() {
384 return this.spellCheckSecondaryText_.length ? 'two-line' : '';
385 },
386
387 /**
379 * Returns either the "selected" class, if the language matches the 388 * Returns either the "selected" class, if the language matches the
380 * prospective UI language, or an empty string. Languages can only be 389 * prospective UI language, or an empty string. Languages can only be
381 * selected on Chrome OS and Windows. 390 * selected on Chrome OS and Windows.
382 * @param {string} languageCode The language code identifying a language. 391 * @param {string} languageCode The language code identifying a language.
383 * @param {string} prospectiveUILanguage The prospective UI language. 392 * @param {string} prospectiveUILanguage The prospective UI language.
384 * @param {boolean} supportsUI Whether Chrome's UI can be shown in this 393 * @param {boolean} supportsUI Whether Chrome's UI can be shown in this
385 * language. 394 * language.
386 * @return {string} The class name for the language item. 395 * @return {string} The class name for the language item.
387 * @private 396 * @private
388 */ 397 */
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (e.target.tagName == expandButtonTag) 520 if (e.target.tagName == expandButtonTag)
512 return; 521 return;
513 522
514 /** @type {!CrExpandButtonElement} */ 523 /** @type {!CrExpandButtonElement} */
515 var expandButton = e.currentTarget.querySelector(expandButtonTag); 524 var expandButton = e.currentTarget.querySelector(expandButtonTag);
516 assert(expandButton); 525 assert(expandButton);
517 expandButton.expanded = !expandButton.expanded; 526 expandButton.expanded = !expandButton.expanded;
518 }, 527 },
519 }); 528 });
520 })(); 529 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698