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

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: 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..f323351dd7e401c37ac5892649f4991bbbf694ca 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);
Kyle Horimoto 2015/06/05 20:14:20 nit: Might not want to output parentControlHTML if
}
});
},
« 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