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

Unified Diff: chrome/browser/resources/settings/appearance_page/home_url_input.js

Issue 2773233002: MD Settings: change settings-input to home-url-input due to reduced usage. (Closed)
Patch Set: updates based on comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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));
+ },
});

Powered by Google App Engine
This is Rietveld 408576698