diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 13:54:28 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 13:54:28 +0000 |
commit | d0ef30f4636680ba1ca213d72bb13540fb5ce7f2 (patch) | |
tree | 5c76b111a2e8a54e7d6343cdf56d6eec4b3cd75b /webkit/glue/webdevtoolsclient_impl.cc | |
parent | 8ee332ca459d463eecb7807ecd966eda13be0456 (diff) | |
download | chromium_src-d0ef30f4636680ba1ca213d72bb13540fb5ce7f2.zip chromium_src-d0ef30f4636680ba1ca213d72bb13540fb5ce7f2.tar.gz chromium_src-d0ef30f4636680ba1ca213d72bb13540fb5ce7f2.tar.bz2 |
Wire 'Inspect Element' action to the new DevTools (depending on the devtools flag):
- Add new devtools IPC message
- Expose WebView's hit target
- Refactor dom_agent interaction not to send information known to client
- Collect incoming messages on the client until frontend is loaded
- Add Inspect Element scenario into the devtools_host_stub
Review URL: http://codereview.chromium.org/45022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webdevtoolsclient_impl.cc')
-rw-r--r-- | webkit/glue/webdevtoolsclient_impl.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc index 269b159..67b8974 100644 --- a/webkit/glue/webdevtoolsclient_impl.cc +++ b/webkit/glue/webdevtoolsclient_impl.cc @@ -12,6 +12,7 @@ #include "Page.h" #include "PlatformString.h" #include <wtf/OwnPtr.h> +#include <wtf/Vector.h> #undef LOG #include "base/json_reader.h" @@ -54,7 +55,8 @@ WebDevToolsClientImpl::WebDevToolsClientImpl( WebViewImpl* web_view_impl, WebDevToolsClientDelegate* delegate) : web_view_impl_(web_view_impl), - delegate_(delegate) { + delegate_(delegate), + loaded_(false) { WebFrame* frame = web_view_impl_->GetMainFrame(); dom_agent_obj_.set(new JsDomAgentBoundObj(this, frame, L"RemoteDomAgent")); net_agent_obj_.set(new JsNetAgentBoundObj(this, frame, L"RemoteNetAgent")); @@ -62,6 +64,7 @@ WebDevToolsClientImpl::WebDevToolsClientImpl( BindToJavascript(frame, L"DevToolsHost"); BindMethod("addSourceToFrame", &WebDevToolsClientImpl::JsAddSourceToFrame); + BindMethod("loaded", &WebDevToolsClientImpl::JsLoaded); } WebDevToolsClientImpl::~WebDevToolsClientImpl() { @@ -69,6 +72,10 @@ WebDevToolsClientImpl::~WebDevToolsClientImpl() { void WebDevToolsClientImpl::DispatchMessageFromAgent( const std::string& raw_msg) { + if (!loaded_) { + pending_incoming_messages_.append(raw_msg); + return; + } OwnPtr<ListValue> message( static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg))); @@ -106,3 +113,15 @@ void WebDevToolsClientImpl::JsAddSourceToFrame( node); result->SetNull(); } + +void WebDevToolsClientImpl::JsLoaded( + const CppArgumentList& args, + CppVariant* result) { + loaded_ = true; + for (Vector<std::string>::iterator it = pending_incoming_messages_.begin(); + it != pending_incoming_messages_.end(); ++it) { + DispatchMessageFromAgent(*it); + } + pending_incoming_messages_.clear(); + result->SetNull(); +} |