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

Unified Diff: webkit/glue/webdevtoolsclient_impl.cc

Issue 113100: DevTools: Activate inspector window on break / exception. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « webkit/glue/webdevtoolsclient_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webdevtoolsclient_impl.cc
===================================================================
--- webkit/glue/webdevtoolsclient_impl.cc (revision 15627)
+++ webkit/glue/webdevtoolsclient_impl.cc (working copy)
@@ -99,28 +99,38 @@
v8::Local<v8::Signature> default_signature =
v8::Signature::New(host_template_);
v8::Local<v8::ObjectTemplate> proto = host_template_->PrototypeTemplate();
+ InitProtoFunction(proto,
+ "addSourceToFrame",
+ WebDevToolsClientImpl::JsAddSourceToFrame,
+ default_signature);
+ InitProtoFunction(proto,
+ "loaded",
+ WebDevToolsClientImpl::JsLoaded,
+ default_signature);
+ InitProtoFunction(proto,
+ "search",
+ WebCore::V8Custom::v8InspectorControllerSearchCallback,
+ default_signature);
+ InitProtoFunction(proto,
+ "activateWindow",
+ WebDevToolsClientImpl::JsActivateWindow,
+ default_signature);
+ host_template_->SetClassName(v8::String::New("DevToolsHost"));
+}
+
+// static
+void WebDevToolsClientImpl::InitProtoFunction(
+ v8::Handle<v8::ObjectTemplate> proto,
+ const char* name,
+ v8::InvocationCallback callback,
+ v8::Handle<v8::Signature> signature) {
proto->Set(
- v8::String::New("addSourceToFrame"),
+ v8::String::New(name),
v8::FunctionTemplate::New(
- WebDevToolsClientImpl::JsAddSourceToFrame,
+ callback,
v8::Handle<v8::Value>(),
- default_signature),
+ signature),
static_cast<v8::PropertyAttribute>(v8::DontDelete));
- proto->Set(
- v8::String::New("loaded"),
- v8::FunctionTemplate::New(
- WebDevToolsClientImpl::JsLoaded,
- 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"));
}
// static
@@ -240,7 +250,10 @@
}
// static
-v8::Handle<v8::Value> WebDevToolsClientImpl::JsSearch(
+v8::Handle<v8::Value> WebDevToolsClientImpl::JsActivateWindow(
const v8::Arguments& args) {
- return WebCore::V8Custom::v8InspectorControllerSearchCallback(args);
+ Page* page = V8Proxy::retrieveActiveFrame()->page();
+ WebDevToolsClientImpl* client = page_to_client_.get(page);
+ client->delegate_->ActivateWindow();
+ return v8::Undefined();
}
« no previous file with comments | « webkit/glue/webdevtoolsclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698