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

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

Issue 2617823002: GRIT: put <if> and <include> behind comments in .js files to make syntactically valid JS (Closed)
Patch Set: add dep Created 3 years, 11 months 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 * @param {string} prospectiveUILanguage The prospective UI language. 346 * @param {string} prospectiveUILanguage The prospective UI language.
347 * @return {boolean} True if the given language matches the prospective UI 347 * @return {boolean} True if the given language matches the prospective UI
348 * pref (which may be different from the actual UI language). 348 * pref (which may be different from the actual UI language).
349 * @private 349 * @private
350 */ 350 */
351 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) { 351 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) {
352 assert(cr.isChromeOS || cr.isWindows); 352 assert(cr.isChromeOS || cr.isWindows);
353 return languageCode == prospectiveUILanguage; 353 return languageCode == prospectiveUILanguage;
354 }, 354 },
355 355
356 <if expr="chromeos or is_win"> 356 // <if expr="chromeos or is_win">
357 /** 357 /**
358 * @param {string} prospectiveUILanguage 358 * @param {string} prospectiveUILanguage
359 * @return {string} 359 * @return {string}
360 * @private 360 * @private
361 */ 361 */
362 getProspectiveUILanguageName_: function(prospectiveUILanguage) { 362 getProspectiveUILanguageName_: function(prospectiveUILanguage) {
363 return this.languageHelper.getLanguage(prospectiveUILanguage).displayName; 363 return this.languageHelper.getLanguage(prospectiveUILanguage).displayName;
364 }, 364 },
365 </if> 365 // </if>
366 366
367 /** 367 /**
368 * @return {string} 368 * @return {string}
369 * @private 369 * @private
370 */ 370 */
371 getLanguageListTwoLine_: function() { 371 getLanguageListTwoLine_: function() {
372 return cr.isChromeOS || cr.isWindows ? 'two-line' : ''; 372 return cr.isChromeOS || cr.isWindows ? 'two-line' : '';
373 }, 373 },
374 374
375 /** 375 /**
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 uiAccountTweaks.UIAccountTweaks.loggedInAsPublicAccount())) { 490 uiAccountTweaks.UIAccountTweaks.loggedInAsPublicAccount())) {
491 menu.querySelector('#uiLanguageItem').hidden = true; 491 menu.querySelector('#uiLanguageItem').hidden = true;
492 } 492 }
493 }, 493 },
494 494
495 /** 495 /**
496 * Handler for the restart button. 496 * Handler for the restart button.
497 * @private 497 * @private
498 */ 498 */
499 onRestartTap_: function() { 499 onRestartTap_: function() {
500 <if expr="chromeos"> 500 // <if expr="chromeos">
501 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart(); 501 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart();
502 </if> 502 // </if>
503 <if expr="not chromeos"> 503 // <if expr="not chromeos">
504 settings.LifetimeBrowserProxyImpl.getInstance().restart(); 504 settings.LifetimeBrowserProxyImpl.getInstance().restart();
505 </if> 505 // </if>
506 }, 506 },
507 507
508 /** 508 /**
509 * Toggles the expand button within the element being listened to. 509 * Toggles the expand button within the element being listened to.
510 * @param {!Event} e 510 * @param {!Event} e
511 * @private 511 * @private
512 */ 512 */
513 toggleExpandButton_: function(e) { 513 toggleExpandButton_: function(e) {
514 // The expand button handles toggling itself. 514 // The expand button handles toggling itself.
515 var expandButtonTag = 'CR-EXPAND-BUTTON'; 515 var expandButtonTag = 'CR-EXPAND-BUTTON';
516 if (e.target.tagName == expandButtonTag) 516 if (e.target.tagName == expandButtonTag)
517 return; 517 return;
518 518
519 /** @type {!CrExpandButtonElement} */ 519 /** @type {!CrExpandButtonElement} */
520 var expandButton = e.currentTarget.querySelector(expandButtonTag); 520 var expandButton = e.currentTarget.querySelector(expandButtonTag);
521 assert(expandButton); 521 assert(expandButton);
522 expandButton.expanded = !expandButton.expanded; 522 expandButton.expanded = !expandButton.expanded;
523 }, 523 },
524 }); 524 });
525 })(); 525 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698