Index: chrome/browser/resources/options2/home_page_overlay.js |
diff --git a/chrome/browser/resources/options2/home_page_overlay.js b/chrome/browser/resources/options2/home_page_overlay.js |
index 780f412922e5372bf725e801f3619544be7d65ff..597f720d8885f8e4a3db8101a36e6ead4189140f 100644 |
--- a/chrome/browser/resources/options2/home_page_overlay.js |
+++ b/chrome/browser/resources/options2/home_page_overlay.js |
@@ -29,9 +29,6 @@ cr.define('options', function() { |
SettingsDialog.prototype.initializePage.call(this); |
var self = this; |
- $('homepage-use-ntp').onchange = this.updateHomePageInput_.bind(this); |
- $('homepage-use-url').onchange = this.updateHomePageInput_.bind(this); |
- |
$('homepageURL').addEventListener('keydown', function(event) { |
// Focus the 'OK' button when the user hits enter since people expect |
// feedback indicating that they are done editing. |
@@ -44,22 +41,21 @@ cr.define('options', function() { |
}, |
/** |
- * @inheritDoc |
+ * Sets the 'show home button' and 'home page is new tab page' preferences. |
+ * (The home page url preference is set automatically by the SettingsDialog |
+ * code.) |
*/ |
- didShowPage: function() { |
- // Set initial state. |
- this.updateHomePageInput_(); |
+ willConfirm: function() { |
+ Preferences.setBooleanPref('browser.show_home_button', true); |
+ Preferences.setBooleanPref('homepage_is_newtabpage', false); |
}, |
/** |
- * Updates the state of the homepage text input. The input is enabled only |
- * if the |homepageUseURLBUtton| radio is checked. |
- * @private |
+ * Resets the <select> on the browser options page to the appropriate value, |
+ * based on the current preferences. |
*/ |
- updateHomePageInput_: function() { |
- var homepageInput = $('homepageURL'); |
- var homepageUseURL = $('homepage-use-url'); |
- homepageInput.setDisabled('radio-choice', !homepageUseURL.checked); |
+ willCancel: function() { |
+ BrowserOptions.getInstance().updateHomePageSelector(); |
}, |
}; |