Index: chrome/browser/resources/certificate_viewer.js |
diff --git a/chrome/browser/resources/certificate_viewer.js b/chrome/browser/resources/certificate_viewer.js |
index 215a5d629ce3817895a522ecb3df354744ff1d08..417f5604149127090ba1f345c62099a21237d685 100644 |
--- a/chrome/browser/resources/certificate_viewer.js |
+++ b/chrome/browser/resources/certificate_viewer.js |
@@ -17,31 +17,17 @@ cr.define('cert_viewer', function() { |
var args = JSON.parse(chrome.dialogArguments); |
getCertificateInfo(args); |
- /** |
- * Initialize the second tab's contents. |
- * This is a 'oneShot' function, meaning it will only be invoked once, |
- * no matter how many times it is called. This is done for unit-testing |
- * purposes in case a test needs to initialize the tab before the timer |
- * fires. |
- */ |
- var initializeDetailTab = oneShot(function() { |
- initializeTree($('hierarchy'), showCertificateFields); |
- initializeTree($('cert-fields'), showCertificateFieldValue); |
- createCertificateHierarchy(args.hierarchy); |
- }); |
- |
// The second tab's contents aren't visible on startup, so we can |
// shorten startup by not populating those controls until after we |
// have had a chance to draw the visible controls the first time. |
// The value of 200ms is quick enough that the user couldn't open the |
// tab in that time but long enough to allow the first tab to draw on |
// even the slowest machine. |
- setTimeout(initializeDetailTab, 200); |
- |
- $('tabbox').addEventListener('selectedChange', function f(e) { |
- $('tabbox').removeEventListener('selectedChange', f); |
- initializeDetailTab(); |
- }); |
+ setTimeout(function() { |
+ initializeTree($('hierarchy'), showCertificateFields); |
+ initializeTree($('cert-fields'), showCertificateFieldValue); |
+ createCertificateHierarchy(args.hierarchy); |
+ }, 200); |
stripGtkAccessorKeys(); |
@@ -55,18 +41,6 @@ cr.define('cert_viewer', function() { |
} |
/** |
- * Decorate a function so that it can only be invoked once. |
- */ |
- function oneShot(fn) { |
- var fired = false; |
- return function() { |
- if (fired) return; |
- fn(); |
- fired = true; |
- }; |
- } |
- |
- /** |
* Initialize a cr.ui.Tree object from a given element using the specified |
* change handler. |
* @param {HTMLElement} tree The HTMLElement to style as a tree. |