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

Unified Diff: Source/devtools/front_end/ContentProviders.js

Issue 18341003: DevTools: [CodeMirror] Add syntax highlighting for some other languages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 7 years, 6 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: Source/devtools/front_end/ContentProviders.js
diff --git a/Source/devtools/front_end/ContentProviders.js b/Source/devtools/front_end/ContentProviders.js
index 792702d6b2623c849551f23782fe6e6a9959e27c..5394c90359b6210641c645d30ae56c22b35a3c62 100644
--- a/Source/devtools/front_end/ContentProviders.js
+++ b/Source/devtools/front_end/ContentProviders.js
@@ -185,6 +185,8 @@ WebInspector.ConcatenatedScriptsContentProvider.prototype = {
/**
* @constructor
* @param {string} sourceURL
+ * @param {WebInspector.ResourceType} contentType
+ * @param {string} mimeType
* @implements {WebInspector.ContentProvider}
*/
WebInspector.CompilerSourceMappingContentProvider = function(sourceURL, contentType, mimeType)
@@ -323,3 +325,59 @@ WebInspector.StaticContentProvider.prototype = {
__proto__: WebInspector.ContentProvider.prototype
}
+
+/**
+ * @constructor
+ * @implements {WebInspector.ContentProvider}
+ * @param {WebInspector.ContentProvider} contentProvider
+ * @param {string} mimeType
+ */
+WebInspector.ContentProviderOverridingMimeType = function(contentProvider, mimeType)
+{
+ this._contentProvider = contentProvider;
+ this._mimeType = mimeType;
+}
+
+WebInspector.ContentProviderOverridingMimeType.prototype = {
+ /**
+ * @return {string}
+ */
+ contentURL: function()
+ {
+ return this._contentProvider.contentURL();
+ },
+
+ /**
+ * @return {WebInspector.ResourceType}
+ */
+ contentType: function()
+ {
+ return this._contentProvider.contentType();
+ },
+
+ /**
+ * @param {function(?string,boolean,string)} callback
+ */
+ requestContent: function(callback)
+ {
+ this._contentProvider.requestContent(innerCallback.bind(this));
+
+ function innerCallback(content, contentEncoded, mimeType)
+ {
+ callback(content, contentEncoded, this._mimeType);
+ }
+ },
+
+ /**
+ * @param {string} query
+ * @param {boolean} caseSensitive
+ * @param {boolean} isRegex
+ * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+ */
+ searchInContent: function(query, caseSensitive, isRegex, callback)
+ {
+ this._contentProvider.searchInContent(query, caseSensitive, isRegex, callback);
+ },
+
+ __proto__: WebInspector.ContentProvider.prototype
+}

Powered by Google App Engine
This is Rietveld 408576698