Chromium Code Reviews| Index: chrome/browser/resources/settings/appearance_page/appearance_page.js |
| diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| index cec64245e5f3368fe3dea9cac644bb4a5402b29d..2446d6945279077901e7a3c7ed9602fcdccaf212 100644 |
| --- a/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| @@ -100,10 +100,10 @@ Polymer({ |
| observers: [ |
| 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)', |
| -// <if expr="is_linux and not chromeos"> |
| + // <if expr="is_linux and not chromeos"> |
|
scottchen
2017/03/23 20:35:51
clang-formatter did all these..
|
| // NOTE: this pref only exists on Linux. |
| 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', |
| -// </if> |
| + // </if> |
| ], |
| created: function() { |
| @@ -158,7 +158,7 @@ Polymer({ |
| window.open(this.themeUrl_ || loadTimeData.getString('themesGalleryUrl')); |
| }, |
| -// <if expr="chromeos"> |
| + // <if expr="chromeos"> |
| /** |
| * ChromeOS only. |
| * @private |
| @@ -166,14 +166,14 @@ Polymer({ |
| openWallpaperManager_: function() { |
| this.browserProxy_.openWallpaperManager(); |
| }, |
| -// </if> |
| + // </if> |
| /** @private */ |
| onUseDefaultTap_: function() { |
| this.browserProxy_.useDefaultTheme(); |
| }, |
| -// <if expr="is_linux and not chromeos"> |
| + // <if expr="is_linux and not chromeos"> |
| /** |
| * @param {boolean} useSystemTheme |
| * @private |
| @@ -218,7 +218,7 @@ Polymer({ |
| onUseSystemTap_: function() { |
| this.browserProxy_.useSystemTheme(); |
| }, |
| -// </if> |
| + // </if> |
| /** |
| * @param {string} themeId |
| @@ -238,12 +238,12 @@ Polymer({ |
| } |
| var i18nId; |
| -// <if expr="is_linux and not chromeos"> |
| + // <if expr="is_linux and not chromeos"> |
| i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme'; |
| -// </if> |
| -// <if expr="not is_linux or chromeos"> |
| + // </if> |
| + // <if expr="not is_linux or chromeos"> |
| i18nId = 'chooseFromWebStore'; |
| -// </if> |
| + // </if> |
| this.themeSublabel_ = this.i18n(i18nId); |
| this.themeUrl_ = ''; |
| }, |
| @@ -272,4 +272,18 @@ Polymer({ |
| zoomValuesEqual_: function(zoom1, zoom2) { |
| return Math.abs(zoom1 - zoom2) <= 0.001; |
| }, |
| + |
| + validate_: function(event) { |
| + var inputElement = Polymer.dom(event).localTarget.$$('#input'); |
| + |
| + if (inputElement.value == '') { |
| + inputElement.invalid = false; |
| + return; |
| + } |
| + |
| + this.browserProxy_.validateStartupPage(inputElement.value) |
| + .then(function(isValid) { |
| + inputElement.invalid = !isValid; |
| + }.bind(this)); |
| + }, |
| }); |