Index: chrome/browser/resources/extensions/extension_loader.js |
diff --git a/chrome/browser/resources/extensions/extension_loader.js b/chrome/browser/resources/extensions/extension_loader.js |
index fb57c18b139075cba35b00c733df28187052c4c9..45a27d04bcd38ec84b9d96e8265e45b59a105b97 100644 |
--- a/chrome/browser/resources/extensions/extension_loader.js |
+++ b/chrome/browser/resources/extensions/extension_loader.js |
@@ -2,6 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+document.addEventListener('DOMContentLoaded', function() { |
+ chrome.send('extensionLoaderDisplayFailures'); |
+}); |
+ |
+window.addEventListener('beforeunload', function() { |
Devlin
2014/06/30 21:06:42
Actually, I'm wondering if this wouldn't be better
gpdavis
2014/06/30 21:41:19
Will the ExtensionLoader be constructed after the
Devlin
2014/06/30 22:32:36
Well, since extensions are loaded on page load, we
gpdavis
2014/06/30 23:35:11
Wait, are you talking about the Extension Loader H
Devlin
2014/07/01 17:02:55
I was talking about the ExtensionLoader JS class.
gpdavis
2014/07/01 20:58:55
I replaced the DOMContentLoaded listener with a me
Devlin
2014/07/01 22:14:17
Can we not just unset it when the page is reloadin
gpdavis
2014/07/01 23:50:59
Well, that is the goal. I figured adding a listen
Devlin
2014/07/02 17:46:49
Can we not just listen for the same signal that Ex
|
+ chrome.send('extensionLoaderSetDisplayLoading'); |
+}); |
+ |
cr.define('extensions', function() { |
'use strict'; |
@@ -38,6 +46,14 @@ cr.define('extensions', function() { |
this.reason_ = this.querySelector('#extension-load-error-reason'); |
/** |
+ * The element which displays information about additional load failures. |
+ * @type {HTMLPreElement} |
+ * @private |
+ */ |
+ this.additional_ = |
+ this.querySelector('#extension-load-error-additional'); |
+ |
+ /** |
* The element which displays the manifest code. |
* @type {ExtensionCode} |
* @private |
@@ -76,6 +92,15 @@ cr.define('extensions', function() { |
}, |
/** |
+ * Display additional load failures to the user. |
Devlin
2014/06/30 21:06:41
We should be able to clean this up when we move al
|
+ * @param {string} failures The error message listing paths of additional |
+ * extensions that failed to load. |
+ */ |
+ showAdditional: function(failures) { |
+ this.additional_.textContent = failures; |
+ }, |
+ |
+ /** |
* Hide the extension load error. |
* @private |
*/ |
@@ -122,6 +147,16 @@ cr.define('extensions', function() { |
*/ |
notifyFailed: function(filePath, reason, manifest) { |
this.loadError_.show(filePath, reason, manifest); |
+ }, |
+ |
+ /** |
+ * Notify the ExtensionLoader of additional failures. |
+ * @param {string} filePath The path to the unpacked extension. |
+ * @param {string} failures The error message listing paths of additional |
+ * extensions that failed to load. |
+ */ |
+ notifyAdditionalFailures: function(failures) { |
+ this.loadError_.showAdditional(failures); |
} |
}; |
@@ -136,6 +171,16 @@ cr.define('extensions', function() { |
ExtensionLoader.getInstance().notifyFailed(filePath, reason, manifest); |
}; |
+ /* |
+ * A static forwarding function for ExtensionLoader.notifyFailed. |
+ * @param {string} failures The error message listing paths of additional |
+ * extensions that failed to load. |
+ * @see ExtensionLoader.notifyAdditionalFailures |
+ */ |
+ ExtensionLoader.notifyAdditional = function(failures) { |
+ ExtensionLoader.getInstance().notifyAdditionalFailures(failures); |
+ }; |
+ |
return { |
ExtensionLoader: ExtensionLoader |
}; |