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

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

Issue 9296038: [uber] Redoing the homepage selection UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 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/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();
},
};

Powered by Google App Engine
This is Rietveld 408576698