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}; |