| Index: chrome/browser/resources/settings/appearance_page/home_url_input.js
|
| diff --git a/chrome/browser/resources/settings/controls/settings_input.js b/chrome/browser/resources/settings/appearance_page/home_url_input.js
|
| similarity index 79%
|
| rename from chrome/browser/resources/settings/controls/settings_input.js
|
| rename to chrome/browser/resources/settings/appearance_page/home_url_input.js
|
| index 0031a07e242dfa2b87d8bc63595c1096e5a00f19..95faaa58fdf48b9fae1115810a3db138b51b5e97 100644
|
| --- a/chrome/browser/resources/settings/controls/settings_input.js
|
| +++ b/chrome/browser/resources/settings/appearance_page/home_url_input.js
|
| @@ -4,11 +4,11 @@
|
|
|
| /**
|
| * @fileoverview
|
| - * `settings-input` is a single-line text field for user input associated
|
| - * with a pref value.
|
| + * `home-url-input` is a single-line text field intending to be used with
|
| + * prefs.homepage
|
| */
|
| Polymer({
|
| - is: 'settings-input',
|
| + is: 'home-url-input',
|
|
|
| behaviors: [CrPolicyPrefBehavior, PrefControlBehavior],
|
|
|
| @@ -20,28 +20,28 @@ Polymer({
|
| */
|
| pref: {observer: 'prefChanged_'},
|
|
|
| - /* The current value of the input, reflected to/from |pref|. */
|
| - value: {
|
| - type: String,
|
| - value: '',
|
| - notify: true,
|
| - },
|
| -
|
| /* Set to true to disable editing the input. */
|
| disabled: {type: Boolean, value: false, reflectToAttribute: true},
|
|
|
| canTab: Boolean,
|
|
|
| - invalid: {
|
| - type: Boolean,
|
| - value: false,
|
| + invalid: {type: Boolean, value: false},
|
| +
|
| + /* The current value of the input, reflected to/from |pref|. */
|
| + value: {
|
| + type: String,
|
| + value: '',
|
| notify: true,
|
| },
|
| + },
|
|
|
| - /* Properties for paper-input. This is not strictly necessary.
|
| - * Though it does define the types for the closure compiler. */
|
| - errorMessage: {type: String},
|
| - label: {type: String},
|
| + /** @private {?settings.AppearanceBrowserProxy} */
|
| + browserProxy_: null,
|
| +
|
| + /** @override */
|
| + created: function() {
|
| + this.browserProxy_ = settings.AppearanceBrowserProxyImpl.getInstance();
|
| + this.noExtensionIndicator = true; // Prevent double indicator.
|
| },
|
|
|
| /**
|
| @@ -126,4 +126,16 @@ Polymer({
|
| isDisabled_: function(disabled) {
|
| return disabled || this.isPrefEnforced();
|
| },
|
| +
|
| + /** @private */
|
| + validate_: function() {
|
| + if (this.value == '') {
|
| + this.invalid = false;
|
| + return;
|
| + }
|
| +
|
| + this.browserProxy_.validateStartupPage(this.value).then(function(isValid) {
|
| + this.invalid = !isValid;
|
| + }.bind(this));
|
| + },
|
| });
|
|
|