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

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: reduce code 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 91%
rename from chrome/browser/resources/settings/controls/settings_input.js
rename to chrome/browser/resources/settings/appearance_page/home_url_input.js
index 52c81984c265ab69e2797f8913c6d07870244aa6..6733e083a2902fe8a6805ea63b5c7b240b4287b1 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],
@@ -115,15 +115,10 @@ Polymer({
*/
onKeydown_: function(event) {
// If pressed enter when input is invalid, do not trigger on-change.
- if (event.key == 'Enter' && this.invalid) {
+ if (event.key == 'Enter' && this.invalid)
event.preventDefault();
- return;
- }
-
- if (event.key != 'Escape')
- return;
-
- this.resetValue_();
+ else if (event.key == 'Escape')
+ this.resetValue_();
},
/**

Powered by Google App Engine
This is Rietveld 408576698