summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/glue/devtools/js/devtools.js35
-rw-r--r--webkit/glue/devtools/js/inspector_controller_impl.js8
-rw-r--r--webkit/glue/webdevtoolsclient_impl.cc15
-rw-r--r--webkit/glue/webdevtoolsclient_impl.h1
4 files changed, 57 insertions, 2 deletions
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index 1432a08..430b9e0 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -420,9 +420,9 @@ WebInspector.SourceView.prototype.setupSourceFrameIfNeeded = function() {
self.sourceFrame.addEventListener('syntax highlighting complete',
self._syntaxHighlightingComplete, self);
self.sourceFrame.syntaxHighlightJavascript();
+ } else {
+ self._sourceFrameSetupFinished();
}
- } else {
- self._sourceFrameSetupFinished();
}
});
return true;
@@ -593,6 +593,37 @@ WebInspector.StylePropertyTreeElement.prototype.applyStyleText = function(
/**
+ * This function overrides standard searchableViews getters to perform search
+ * only in the current view (other views are loaded asynchronously, no way to
+ * search them yet).
+ */
+WebInspector.searchableViews_ = function() {
+ var views = [];
+ const visibleView = this.visibleView;
+ if (visibleView && visibleView.performSearch) {
+ views.push(visibleView);
+ }
+ return views;
+};
+
+
+/**
+ * @override
+ */
+WebInspector.ResourcesPanel.prototype.__defineGetter__(
+ 'searchableViews',
+ WebInspector.searchableViews_);
+
+
+/**
+ * @override
+ */
+WebInspector.ScriptsPanel.prototype.__defineGetter__(
+ 'searchableViews',
+ WebInspector.searchableViews_);
+
+
+/**
* @override
*/
WebInspector.Console.prototype._evalInInspectedWindow = function(expression) {
diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js
index 8871675..45abbe2 100644
--- a/webkit/glue/devtools/js/inspector_controller_impl.js
+++ b/webkit/glue/devtools/js/inspector_controller_impl.js
@@ -36,6 +36,14 @@ devtools.InspectorControllerImpl.prototype.hiddenPanels = function() {
/**
* {@inheritDoc}.
*/
+devtools.InspectorController.prototype.search = function(sourceRow, query) {
+ return DevToolsHost.search(sourceRow, query);
+};
+
+
+/**
+ * {@inheritDoc}.
+ */
devtools.InspectorControllerImpl.prototype.addSourceToFrame =
function(mimeType, source, element) {
return DevToolsHost.addSourceToFrame(mimeType, source, element);
diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc
index 7d8f66a..62c5f6a 100644
--- a/webkit/glue/webdevtoolsclient_impl.cc
+++ b/webkit/glue/webdevtoolsclient_impl.cc
@@ -19,6 +19,7 @@
#undef LOG
#include "V8Binding.h"
+#include "v8_custom.h"
#include "v8_proxy.h"
#include "v8_utility.h"
#include "base/string_util.h"
@@ -112,6 +113,13 @@ void WebDevToolsClientImpl::InitBoundObject() {
v8::Handle<v8::Value>(),
default_signature),
static_cast<v8::PropertyAttribute>(v8::DontDelete));
+ proto->Set(
+ v8::String::New("search"),
+ v8::FunctionTemplate::New(
+ WebDevToolsClientImpl::JsSearch,
+ v8::Handle<v8::Value>(),
+ default_signature),
+ static_cast<v8::PropertyAttribute>(v8::DontDelete));
host_template_->SetClassName(v8::String::New("DevToolsHost"));
}
@@ -201,6 +209,7 @@ v8::Handle<v8::Value> WebDevToolsClientImpl::JsAddSourceToFrame(
}
Node* node = V8Proxy::DOMWrapperToNode<Node>(args[2]);
if (!node || !node->attached()) {
+ return v8::Undefined();
}
Page* page = V8Proxy::retrieveActiveFrame()->page();
@@ -229,3 +238,9 @@ v8::Handle<v8::Value> WebDevToolsClientImpl::JsLoaded(
client->pending_incoming_messages_.clear();
return v8::Undefined();
}
+
+// static
+v8::Handle<v8::Value> WebDevToolsClientImpl::JsSearch(
+ const v8::Arguments& args) {
+ return WebCore::V8Custom::v8InspectorControllerSearchCallback(args);
+}
diff --git a/webkit/glue/webdevtoolsclient_impl.h b/webkit/glue/webdevtoolsclient_impl.h
index 65d9095..e6127f4 100644
--- a/webkit/glue/webdevtoolsclient_impl.h
+++ b/webkit/glue/webdevtoolsclient_impl.h
@@ -45,6 +45,7 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
private:
static v8::Handle<v8::Value> JsAddSourceToFrame(const v8::Arguments& args);
static v8::Handle<v8::Value> JsLoaded(const v8::Arguments& args);
+ static v8::Handle<v8::Value> JsSearch(const v8::Arguments& args);
static v8::Persistent<v8::FunctionTemplate> host_template_;
static HashMap<WebCore::Page*, WebDevToolsClientImpl*> page_to_client_;