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

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: Addressed estade's comments 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..ffd838e4a2c7fa0d24f777617a75f8a37c5b43be 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -71,13 +71,16 @@ 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_)
+ chrome.send('enableInstant');
+ else
+ OptionsPage.navigateToPage('instantConfirm');
+ } else {
+ chrome.send('disableInstant');
}
+ return true;
};
Preferences.getInstance().addEventListener('instant.confirm_dialog_shown',
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/resources/options/instant_confirm_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698