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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 6332006: DOMUI Prefs: Improve saving of homepage pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 22a45952e94ed15d4f6c1d837e2b3eb39961da8a..de335b02307dc66880b9b0e3947337fedf6815a8 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -69,8 +69,8 @@ cr.define('options', function() {
this.handleHomepageUseNTPButtonChange_.bind(this);
$('homepageUseURLButton').onchange =
this.handleHomepageUseURLButtonChange_.bind(this);
- homepageField.onchange =
- this.handleHomepageURLChange_.bind(this);
+ homepageField.onchange = this.handleHomepageURLChange_.bind(this);
+ homepageField.oninput = this.handleHomepageURLChange_.bind(this);
// Ensure that changes are committed when closing the page.
window.addEventListener('unload', function() {
@@ -203,12 +203,13 @@ cr.define('options', function() {
},
/**
- * Handles change events of the text field 'homepageURL'.
+ * Handles input and change events of the text field 'homepageURL'.
* @private
- * @param {event} change event.
+ * @param {event} input/change event.
*/
handleHomepageURLChange_: function(event) {
- Preferences.setStringPref('homepage', $('homepageURL').value);
+ var doFixup = event.type == 'change' ? '1' : '0';
+ chrome.send('setHomePage', [$('homepageURL').value, doFixup]);
},
/**

Powered by Google App Engine
This is Rietveld 408576698