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

Unified Diff: Source/devtools/front_end/common/StaticContentProvider.js

Issue 471433004: DevTools: Split out the "workspace" and "bindings" modules from "sdk" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove marker interfaces and WI.SourceMapping Created 6 years, 4 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
« no previous file with comments | « Source/devtools/front_end/common/ResourceType.js ('k') | Source/devtools/front_end/inspector.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/common/StaticContentProvider.js
diff --git a/Source/devtools/front_end/common/StaticContentProvider.js b/Source/devtools/front_end/common/StaticContentProvider.js
new file mode 100644
index 0000000000000000000000000000000000000000..8089f976b1af5215cdaddfd899b681cd8d4067ce
--- /dev/null
+++ b/Source/devtools/front_end/common/StaticContentProvider.js
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @constructor
+ * @implements {WebInspector.ContentProvider}
+ * @param {!WebInspector.ResourceType} contentType
+ * @param {string} content
+ */
+WebInspector.StaticContentProvider = function(contentType, content)
+{
+ this._content = content;
+ this._contentType = contentType;
+}
+
+WebInspector.StaticContentProvider.prototype = {
+ /**
+ * @return {string}
+ */
+ contentURL: function()
+ {
+ return "";
+ },
+
+ /**
+ * @return {!WebInspector.ResourceType}
+ */
+ contentType: function()
+ {
+ return this._contentType;
+ },
+
+ /**
+ * @param {function(?string)} callback
+ */
+ requestContent: function(callback)
+ {
+ callback(this._content);
+ },
+
+ /**
+ * @param {string} query
+ * @param {boolean} caseSensitive
+ * @param {boolean} isRegex
+ * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
+ */
+ searchInContent: function(query, caseSensitive, isRegex, callback)
+ {
+ /**
+ * @this {WebInspector.StaticContentProvider}
+ */
+ function performSearch()
+ {
+ callback(WebInspector.ContentProvider.performSearchInContent(this._content, query, caseSensitive, isRegex));
+ }
+
+ // searchInContent should call back later.
+ self.setTimeout(performSearch.bind(this), 0);
+ }
+}
« no previous file with comments | « Source/devtools/front_end/common/ResourceType.js ('k') | Source/devtools/front_end/inspector.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698