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

Unified Diff: chrome/renderer/resources/neterror.js

Issue 23434002: DNS probes: several tweaks to error page updating (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nits, plus indent neterror.html consistently. Created 7 years, 4 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 | « chrome/renderer/resources/neterror.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/neterror.js
diff --git a/chrome/renderer/resources/neterror.js b/chrome/renderer/resources/neterror.js
index 2dd8934698c204eb01e3e2a8948fec5c642e7165..99f19e35429d29c2d9600d3cf5bfc5484ba50264 100644
--- a/chrome/renderer/resources/neterror.js
+++ b/chrome/renderer/resources/neterror.js
@@ -27,10 +27,30 @@ function diagnoseErrors() {
if (window.top.location != window.location)
document.documentElement.setAttribute('subframe', '');
+// Re-renders the error page using |strings| as the dictionary of values.
+// Used by NetErrorTabHelper to update DNS error pages with probe results.
function updateForDnsProbe(strings) {
+ i18nTemplate.process(document, strings);
var context = new JsEvalContext(strings);
- jstProcess(context, document.getElementById('help-box-outer'));
- jstProcess(context, document.getElementById('details'));
+ jstProcess(context, document.getElementById('t'));
+}
+
+// Given the classList property of an element, adds an icon class to the list
+// and removes the previously-
+function updateIconClass(classList, newClass) {
+ var oldClass;
+
+ if (classList.hasOwnProperty('last_icon_class')) {
+ oldClass = classList['last_icon_class']
+ if (oldClass == newClass)
+ return;
+ }
+
+ classList.add(newClass);
+ if (oldClass !== undefined)
+ classList.remove(oldClass);
+
+ classList['last_icon_class'] = newClass;
}
<if expr="is_macosx or is_ios or is_linux or is_android">
« no previous file with comments | « chrome/renderer/resources/neterror.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698