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

Unified Diff: chrome/browser/resources/md_extensions/load_error.js

Issue 2769293002: [MD Extensions] Include the manifest code snippet in load errors (Closed)
Patch Set: . Created 3 years, 9 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
Index: chrome/browser/resources/md_extensions/load_error.js
diff --git a/chrome/browser/resources/md_extensions/load_error.js b/chrome/browser/resources/md_extensions/load_error.js
index 75b47ffa558815f0ae0f5e530b142becd8714191..942407dc3e40d2ec0e37027f3a9f420a03c03c45 100644
--- a/chrome/browser/resources/md_extensions/load_error.js
+++ b/chrome/browser/resources/md_extensions/load_error.js
@@ -19,11 +19,14 @@ cr.define('extensions', function() {
/** @type {extensions.LoadErrorDelegate} */
delegate: Object,
- error: String,
-
- filePath: String,
+ /** @type {chrome.developerPrivate.LoadError} */
+ loadError: Object,
},
+ observers: [
+ 'observeLoadErrorChanges_(loadError)',
+ ],
+
show: function() {
this.$$('dialog').showModal();
},
@@ -37,6 +40,25 @@ cr.define('extensions', function() {
this.delegate.retryLoadUnpacked();
this.close();
},
+
+ /** @private */
+ observeLoadErrorChanges_: function() {
+ assert(this.loadError);
+ var source = this.loadError.source;
+ // CodeSection expects a RequestFileSourceResponse, rather than an
+ // ErrorFileSource. Massage into place.
+ // TODO(devlin): Make RequestFileSourceResponse use ErrorFileSource.
+ /** @type {!chrome.developerPrivate.RequestFileSourceResponse} */
+ var codeSectionProperties = {
+ beforeHighlight: source ? source.beforeHighlight : '',
+ highlight: source ? source.highlight : '',
+ afterHighlight: source ? source.afterHighlight : '',
+ title: '',
+ message: this.loadError.error,
+ };
+
+ this.$.code.code = codeSectionProperties;
+ },
});
return {LoadError: LoadError,
« no previous file with comments | « chrome/browser/resources/md_extensions/load_error.html ('k') | chrome/browser/resources/md_extensions/service.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698