summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-26 18:17:13 +0000
committerrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-26 18:17:13 +0000
commit02089256b85fe7fe83d9088a372944e86ed59774 (patch)
treead4055cce827563ae688c596d7cc7b9e8cc10e51
parent327ff8f069aaf2eb7382ebe42cc0e545e083af54 (diff)
downloadchromium_src-02089256b85fe7fe83d9088a372944e86ed59774.zip
chromium_src-02089256b85fe7fe83d9088a372944e86ed59774.tar.gz
chromium_src-02089256b85fe7fe83d9088a372944e86ed59774.tar.bz2
Fix Regression in Unpacked Extension Load Error UI
A regression where we stopped showing the manifest error was introduced in r283852. Fix it. TBR=finnur@chromium.org BUG=397467 Review URL: https://codereview.chromium.org/422533002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285770 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/extensions/extension_loader.js22
-rw-r--r--chrome/browser/ui/webui/extensions/extension_loader_handler.cc2
2 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/resources/extensions/extension_loader.js b/chrome/browser/resources/extensions/extension_loader.js
index 3882a25..9c306af 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'));
diff --git a/chrome/browser/ui/webui/extensions/extension_loader_handler.cc b/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
index 0bc5aa9..07928d7 100644
--- a/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
@@ -233,7 +233,7 @@ void ExtensionLoaderHandler::OnLoadFailure(const base::FilePath& file_path,
size_t line = 0u;
size_t column = 0u;
std::string regex =
- base::StringPrintf("%s Line: (\\d+), column: (\\d+), Syntax error.",
+ base::StringPrintf("%s Line: (\\d+), column: (\\d+), .*",
manifest_errors::kManifestParseError);
// If this was a JSON parse error, we can highlight the exact line with the
// error. Otherwise, we should still display the manifest (for consistency,