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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 7396025: Refactor Instant web UI (chrome://settings page). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New approach (keep checkbox tied to pref) Created 9 years, 5 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/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 9a043143cc7d1fcc8cd3d17c6ddec8272421ef3a..fa306f091a6f1124d9bea7595bf751951e99b200 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -71,13 +71,17 @@ cr.define('options', function() {
$('defaultSearchEngine').onchange = this.setDefaultSearchEngine_;
var self = this;
- $('instantEnableCheckbox').onclick = function(event) {
- if (this.checked && !self.instantConfirmDialogShown_) {
- // Leave disabled for now. The PrefCheckbox handler already set it to
- // true so undo that.
- Preferences.setBooleanPref(this.pref, false, this.metric);
- OptionsPage.navigateToPage('instantConfirm');
+ $('instantEnabledCheckbox').customChangeHandler = function(event) {
+ if (this.checked) {
+ if (self.instantConfirmDialogShown_) {
Evan Stade 2011/07/25 23:01:34 nit: no curlies
sreeram 2011/07/25 23:56:42 Done.
+ chrome.send('enableInstant');
+ } else {
+ OptionsPage.navigateToPage('instantConfirm');
+ }
+ } else {
+ chrome.send('disableInstant');
}
+ return true;
};
Preferences.getInstance().addEventListener('instant.confirm_dialog_shown',

Powered by Google App Engine
This is Rietveld 408576698