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

Unified Diff: chrome/browser/resources/settings/pref_tracker/pref_tracker.js

Issue 1148303007: Use parent host outer html as the key hint for pref errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: default to "Unknown" Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/pref_tracker/pref_tracker.js
diff --git a/chrome/browser/resources/settings/pref_tracker/pref_tracker.js b/chrome/browser/resources/settings/pref_tracker/pref_tracker.js
index b042ecafb332267780d5511da7f5b582fe256e3b..07b9736e2331e95d884b68c34c3c9d7772f2de50 100644
--- a/chrome/browser/resources/settings/pref_tracker/pref_tracker.js
+++ b/chrome/browser/resources/settings/pref_tracker/pref_tracker.js
@@ -68,14 +68,11 @@
// HACK ALERT: This is the best clue we have as to the pref key for
// this tracker. This value should not be relied upon anywhere or
// actually used besides for this error message.
- var keyHint = '';
- var parentPrefString = this.parentNode && this.parentNode.host &&
- this.parentNode.host.getAttribute('pref');
- if (parentPrefString) {
- keyHint = parentPrefString.match(/{{([a-z0-9._]+)}}/)[1];
- }
+ var parentControlHTML = this.parentNode && this.parentNode.host &&
+ this.parentNode.host.outerHTML;
- throw new Error('Pref not found. Key Hint: ' + keyHint);
+ throw new Error('Pref not found. Parent control:' +
+ (parentControlHTML || 'Unknown');
}
});
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698