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

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: reverting a couple unintentional changes 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 58f758377c3886df762c0e3414439fc1c13401a4..629f0353decc1be21c85e1b2f6daf8fd3df0d920 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,22 @@ 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() {
+ BrowserOptions.getInstance().homePageSelectUrl();
+ });
csilv 2012/02/01 20:37:29 My preference is to not do this... and instead let
Tyler Breisacher (Chromium) 2012/02/01 21:49:38 If the user cancels then the preference doesn't ch
- /**
- * 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.disabled = !homepageUseURL.checked;
},
};

Powered by Google App Engine
This is Rietveld 408576698