1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * @implements {WebInspector.ContentProvider}
8 * @param {!WebInspector.ResourceType} contentType
9 * @param {string} content
11 WebInspector.StaticContentProvider = function(contentType, content)
13 this._content = content;
14 this._contentType = contentType;
17 WebInspector.StaticContentProvider.prototype = {
21 contentURL: function()
27 * @return {!WebInspector.ResourceType}
29 contentType: function()
31 return this._contentType;
35 * @param {function(?string)} callback
37 requestContent: function(callback)
39 callback(this._content);
43 * @param {string} query
44 * @param {boolean} caseSensitive
45 * @param {boolean} isRegex
46 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
48 searchInContent: function(query, caseSensitive, isRegex, callback)
51 * @this {WebInspector.StaticContentProvider}
53 function performSearch()
55 callback(WebInspector.ContentProvider.performSearchInContent(this._content, query, caseSensitive, isRegex));
58 // searchInContent should call back later.
59 self.setTimeout(performSearch.bind(this), 0);