| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 * @param {string} prospectiveUILanguage The prospective UI language. | 359 * @param {string} prospectiveUILanguage The prospective UI language. |
| 360 * @return {boolean} True if the given language matches the prospective UI | 360 * @return {boolean} True if the given language matches the prospective UI |
| 361 * pref (which may be different from the actual UI language). | 361 * pref (which may be different from the actual UI language). |
| 362 * @private | 362 * @private |
| 363 */ | 363 */ |
| 364 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) { | 364 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) { |
| 365 assert(cr.isChromeOS || cr.isWindows); | 365 assert(cr.isChromeOS || cr.isWindows); |
| 366 return languageCode == this.languageHelper.getProspectiveUILanguage(); | 366 return languageCode == this.languageHelper.getProspectiveUILanguage(); |
| 367 }, | 367 }, |
| 368 | 368 |
| 369 <if expr="chromeos or is_win"> |
| 369 /** | 370 /** |
| 370 * @return {string} | 371 * @return {string} |
| 371 * @private | 372 * @private |
| 372 */ | 373 */ |
| 373 getProspectiveUILanguageName_: function() { | 374 getProspectiveUILanguageName_: function() { |
| 374 return this.languageHelper.getLanguage( | 375 return this.languageHelper.getLanguage( |
| 375 this.languageHelper.getProspectiveUILanguage()).displayName; | 376 this.languageHelper.getProspectiveUILanguage()).displayName; |
| 376 }, | 377 }, |
| 378 </if> |
| 379 |
| 380 /** |
| 381 * @return {string} |
| 382 * @private |
| 383 */ |
| 384 getLanguageListTwoLine_: function() { |
| 385 return cr.isChromeOS || cr.isWindows ? 'two-line' : ''; |
| 386 }, |
| 377 | 387 |
| 378 /** | 388 /** |
| 379 * Returns either the "selected" class, if the language matches the | 389 * Returns either the "selected" class, if the language matches the |
| 380 * prospective UI language, or an empty string. Languages can only be | 390 * prospective UI language, or an empty string. Languages can only be |
| 381 * selected on Chrome OS and Windows. | 391 * selected on Chrome OS and Windows. |
| 382 * @param {string} languageCode The language code identifying a language. | 392 * @param {string} languageCode The language code identifying a language. |
| 383 * @param {string} prospectiveUILanguage The prospective UI language. | 393 * @param {string} prospectiveUILanguage The prospective UI language. |
| 384 * @param {boolean} supportsUI Whether Chrome's UI can be shown in this | 394 * @param {boolean} supportsUI Whether Chrome's UI can be shown in this |
| 385 * language. | 395 * language. |
| 386 * @return {string} The class name for the language item. | 396 * @return {string} The class name for the language item. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 onRestartTap_: function() { | 504 onRestartTap_: function() { |
| 495 <if expr="chromeos"> | 505 <if expr="chromeos"> |
| 496 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart(); | 506 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart(); |
| 497 </if> | 507 </if> |
| 498 <if expr="not chromeos"> | 508 <if expr="not chromeos"> |
| 499 settings.LifetimeBrowserProxyImpl.getInstance().restart(); | 509 settings.LifetimeBrowserProxyImpl.getInstance().restart(); |
| 500 </if> | 510 </if> |
| 501 }, | 511 }, |
| 502 }); | 512 }); |
| 503 })(); | 513 })(); |
| OLD | NEW |