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

Unified Diff: chrome/browser/resources/options2/home_page_overlay.js

Issue 9353019: Revert 120803 - [uber] Redoing the homepage selection UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/options2/home_page_overlay.js
===================================================================
--- chrome/browser/resources/options2/home_page_overlay.js (revision 120816)
+++ chrome/browser/resources/options2/home_page_overlay.js (working copy)
@@ -31,6 +31,9 @@
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.
@@ -43,21 +46,22 @@
},
/**
- * 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.)
+ * @inheritDoc
*/
- willConfirm: function() {
- Preferences.setBooleanPref('browser.show_home_button', true);
- Preferences.setBooleanPref('homepage_is_newtabpage', false);
+ didShowPage: function() {
+ // Set initial state.
+ this.updateHomePageInput_();
},
/**
- * Resets the <select> on the browser options page to the appropriate value,
- * based on the current preferences.
+ * Updates the state of the homepage text input. The input is enabled only
+ * if the |homepageUseURLBUtton| radio is checked.
+ * @private
*/
- willCancel: function() {
- BrowserOptions.getInstance().updateHomePageSelector();
+ updateHomePageInput_: function() {
+ var homepageInput = $('homepageURL');
+ var homepageUseURL = $('homepage-use-url');
+ homepageInput.setDisabled('radio-choice', !homepageUseURL.checked);
},
};
« no previous file with comments | « chrome/browser/resources/options2/home_page_overlay.html ('k') | chrome/browser/resources/options2/options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698