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

Unified Diff: chrome/browser/resources/extensions/extension_loader.js

Issue 422533002: Fix Regression in Unpacked Extension Load Error UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | chrome/browser/ui/webui/extensions/extension_loader_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3882a25741c60a9e6448cab8c4ee3a2829591f44..9c306af6e449064b9fc448bea39fae0724c81d9c 100644
--- a/chrome/browser/resources/extensions/extension_loader.js
+++ b/chrome/browser/resources/extensions/extension_loader.js
@@ -19,7 +19,7 @@ cr.define('extensions', function() {
/**
* Construct a Failure.
* @param {string} filePath The path to the unpacked extension.
- * @param {string} reason The reason the extension failed to load.
+ * @param {string} error The reason the extension failed to load.
* @param {Object} manifest An object with three strings: beforeHighlight,
* afterHighlight, and highlight. These represent three portions of the
* file's content to display - the portion which is most relevant and
@@ -29,9 +29,9 @@ cr.define('extensions', function() {
* failure path for the additional failures UI.
* @constructor
*/
- function Failure(filePath, reason, manifest, listElement) {
+ function Failure(filePath, error, manifest, listElement) {
this.path = filePath;
- this.reason = reason;
+ this.error = error;
this.manifest = manifest;
this.listElement = listElement;
}
@@ -106,13 +106,15 @@ cr.define('extensions', function() {
// If a failure is already being displayed, unhide the last item.
if (this.failures_.length > 0)
this.failures_[this.failures_.length - 1].listElement.hidden = false;
- for (var i = 0; i < failures.length; ++i) {
+ failures.forEach(function(failure) {
var listItem = document.createElement('li');
- listItem.textContent = failures[i].path;
+ listItem.textContent = failure.path;
this.additional_.list.appendChild(listItem);
- failures[i].listElement = listItem;
- this.failures_.push(failures[i]);
- }
+ this.failures_.push(new Failure(failure.path,
+ failure.error,
+ failure.manifest,
+ listItem));
+ }.bind(this));
// Hide the last item because the UI is displaying its information.
this.failures_[this.failures_.length - 1].listElement.hidden = true;
this.show_();
@@ -146,9 +148,9 @@ cr.define('extensions', function() {
assert(this.failures_.length >= 1);
var failure = this.failures_[this.failures_.length - 1];
this.path_.textContent = failure.path;
- this.reason_.textContent = failure.reason;
+ this.reason_.textContent = failure.error;
- failure.manifest.message = failure.reason;
+ failure.manifest.message = failure.error;
this.manifest_.populate(
failure.manifest,
loadTimeData.getString('extensionLoadCouldNotLoadManifest'));
« no previous file with comments | « no previous file | chrome/browser/ui/webui/extensions/extension_loader_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698