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

Unified Diff: chrome/browser/resources/options/pref_ui.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/pref_ui.js
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index 16af4d0231cbca3ba89434fb804a25f074865f43..2d88886bf2a066d745c0cbb5b0892d4376e871ba 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -98,6 +98,8 @@ cr.define('options', function() {
this.addEventListener(
'change',
function(e) {
+ if (self.customChangeHandler(e))
+ return;
var value = self.inverted_pref ? !self.checked : self.checked;
switch(self.valueType) {
case 'number':
@@ -126,6 +128,17 @@ cr.define('options', function() {
setDisabled: function(reason, disabled) {
updateDisabledState_(this, reason, disabled);
},
+
+ /**
+ * This method is called first while processing an onchange event. If it
+ * returns false, regular onchange processing continues (setting the
+ * associated pref, etc). If it returns true, the rest of the onchange is
+ * not performed. I.e., this works like stopPropagation or cancelBubble.
+ * @param {Event} event Change event.
+ */
+ customChangeHandler: function(event) {
+ return false;
+ },
};
/**
« no previous file with comments | « chrome/browser/resources/options/instant_confirm_overlay.js ('k') | chrome/browser/ui/webui/options/browser_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698