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

Unified Diff: chrome/browser/resources/md_extensions/code_section.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/code_section.js
diff --git a/chrome/browser/resources/md_extensions/code_section.js b/chrome/browser/resources/md_extensions/code_section.js
index d0a93e2aac26986641c78f2ba764867322b36546..502c86dc1fffea9e53fba639fb71bef9c0751e92 100644
--- a/chrome/browser/resources/md_extensions/code_section.js
+++ b/chrome/browser/resources/md_extensions/code_section.js
@@ -21,10 +21,22 @@ cr.define('extensions', function() {
},
/**
- * The string to display if no code is set.
+ * The string to display if no |code| is set (e.g. because we couldn't
+ * load the relevant source file).
* @type {string}
*/
- noCodeError: String,
+ couldNotDisplayCode: String,
+ },
+
+ /**
+ * Returns true if no code could be displayed (e.g. because the file could
+ * not be loaded).
+ * @return {boolean}
+ */
+ isEmpty: function() {
+ return !this.code ||
+ (!this.code.beforeHighlight && !this.code.highlight &&
+ !this.code.afterHighlight);
},
/**
@@ -46,14 +58,6 @@ cr.define('extensions', function() {
textContent += i + '\n';
return textContent;
},
-
- /**
- * @return {boolean}
- * @private
- */
- isMainHidden_: function() {
- return !this.code;
- },
});
return {CodeSection: CodeSection};

Powered by Google App Engine
This is Rietveld 408576698