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..838181fd3de1a8394d0f14dbf258e6538340be3f 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. |
@@ -41,25 +38,23 @@ cr.define('options', function() { |
// TODO(jhawkins): Refactor BrowserOptions.autocompleteList and use it |
// here. |
- }, |
- /** |
- * @inheritDoc |
- */ |
- didShowPage: function() { |
- // Set initial state. |
- this.updateHomePageInput_(); |
- }, |
+ // Extra functionality for the OK/cancel buttons, separate from what the |
+ // SettingsDialog provides |
+ |
+ // TODO(tbreisacher): This doesn't quite work because users can also |
+ // cancel by pressing 'ESC'. We could just override the handleCancel_ |
+ // method from SettingsDialog, but it's private. |
+ |
+ $('home-page-cancel').addEventListener('click', function() { |
+ BrowserOptions.getInstance().updateHomePageSelector(); |
+ }); |
+ |
+ $('home-page-confirm').addEventListener('click', function() { |
+ Preferences.setBooleanPref('browser.show_home_button', true); |
+ Preferences.setBooleanPref('homepage_is_newtabpage', false); |
+ }); |
csilv
2012/02/02 01:36:40
We should probably change SettingsDialog so that t
Tyler Breisacher (Chromium)
2012/02/02 18:52:45
Done.
|
- /** |
- * Updates the state of the homepage text input. The input is enabled only |
- * if the |homepageUseURLBUtton| radio is checked. |
- * @private |
- */ |
- updateHomePageInput_: function() { |
- var homepageInput = $('homepageURL'); |
- var homepageUseURL = $('homepage-use-url'); |
- homepageInput.setDisabled('radio-choice', !homepageUseURL.checked); |
}, |
}; |