| Index: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
|
| index 77696bb6f323c1895400ad717dc6d90d2ebb701e..3ca043e94455d814e7afeccb06c0a6791b773aaf 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
|
| @@ -28,6 +28,18 @@ WebInspector.CSSStyleSheetHeader = function(cssModel, payload)
|
|
|
| WebInspector.CSSStyleSheetHeader.prototype = {
|
| /**
|
| + * @return {!WebInspector.ContentProvider}
|
| + */
|
| + originalContentProvider: function()
|
| + {
|
| + if (!this._originalContentProvider) {
|
| + var originalContentPromise = this._cssModel.originalStyleSheetText(this);
|
| + this._originalContentProvider = new WebInspector.StaticContentProvider(this.contentURL(), this.contentType(), originalContentPromise);
|
| + }
|
| + return this._originalContentProvider;
|
| + },
|
| +
|
| + /**
|
| * @param {string=} sourceMapURL
|
| */
|
| setSourceMapURL: function(sourceMapURL)
|
| @@ -123,6 +135,10 @@ WebInspector.CSSStyleSheetHeader.prototype = {
|
|
|
| /**
|
| * @override
|
| + * @param {string} query
|
| + * @param {boolean} caseSensitive
|
| + * @param {boolean} isRegex
|
| + * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
|
| */
|
| searchInContent: function(query, caseSensitive, isRegex, callback)
|
| {
|
| @@ -144,3 +160,62 @@ WebInspector.CSSStyleSheetHeader.prototype = {
|
| }
|
| }
|
|
|
| +/**
|
| + * @constructor
|
| + * @implements {WebInspector.ContentProvider}
|
| + * @param {!WebInspector.CSSStyleSheetHeader} header
|
| + */
|
| +WebInspector.CSSStyleSheetHeader.OriginalContentProvider = function(header)
|
| +{
|
| + this._header = header;
|
| +}
|
| +
|
| +WebInspector.CSSStyleSheetHeader.OriginalContentProvider.prototype = {
|
| + /**
|
| + * @override
|
| + * @return {string}
|
| + */
|
| + contentURL: function()
|
| + {
|
| + return this._header.contentURL();
|
| + },
|
| +
|
| + /**
|
| + * @override
|
| + * @return {!WebInspector.ResourceType}
|
| + */
|
| + contentType: function()
|
| + {
|
| + return this._header.contentType();
|
| + },
|
| +
|
| + /**
|
| + * @override
|
| + * @return {!Promise<?string>}
|
| + */
|
| + requestContent: function()
|
| + {
|
| + return /** @type {!Promise<?string>} */(this._header.cssModel().originalStyleSheetText(this._header));
|
| + },
|
| +
|
| + /**
|
| + * @override
|
| + * @param {string} query
|
| + * @param {boolean} caseSensitive
|
| + * @param {boolean} isRegex
|
| + * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
|
| + */
|
| + searchInContent: function(query, caseSensitive, isRegex, callback)
|
| + {
|
| + /**
|
| + * @param {?string} content
|
| + */
|
| + function performSearch(content)
|
| + {
|
| + var searchResults = content ? WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : [];
|
| + callback(searchResults);
|
| + }
|
| +
|
| + this.requestContent().then(performSearch);
|
| + }
|
| +}
|
|
|