summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 03:31:55 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 03:31:55 +0000
commitcd1c89e833b7e67b7a7ca8799122e07b65999771 (patch)
tree8be5bb7ffacaee015edc085026d811a571fc7cc0 /chrome/renderer
parentb67d748a27218fe026449cd98b1ac334c1266d4c (diff)
downloadchromium_src-cd1c89e833b7e67b7a7ca8799122e07b65999771.zip
chromium_src-cd1c89e833b7e67b7a7ca8799122e07b65999771.tar.gz
chromium_src-cd1c89e833b7e67b7a7ca8799122e07b65999771.tar.bz2
Move WebDevToolsAgent{Delegate} into the WebKit API.
Moves corresponding WebView and WebViewDelegate methods too. This uses the term "Frontend" for what was previously known as "Client" in the devtools interfaces. This is to avoid awkward "ClientClient" naming. Frontend was Pavel Feldman's suggested renaming. In a follow up patch, I will be renaming WebDevToolsClient{Delegate} to WebDevToolsFrontend{Client}. R=dglazkov BUG=24597 TEST=none Review URL: http://codereview.chromium.org/287009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/devtools_agent.cc35
-rw-r--r--chrome/renderer/devtools_agent.h28
-rw-r--r--chrome/renderer/devtools_agent_filter.cc7
-rw-r--r--chrome/renderer/devtools_agent_filter.h2
-rw-r--r--chrome/renderer/external_host_bindings.cc1
-rw-r--r--chrome/renderer/notification_provider.cc1
-rw-r--r--chrome/renderer/print_web_view_helper.h3
-rw-r--r--chrome/renderer/render_view.cc11
-rw-r--r--chrome/renderer/render_view.h3
9 files changed, 51 insertions, 40 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index 7d0f279..3a05c25 100644
--- a/chrome/renderer/devtools_agent.cc
+++ b/chrome/renderer/devtools_agent.cc
@@ -7,9 +7,12 @@
#include "chrome/common/devtools_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_view.h"
+#include "webkit/api/public/WebDevToolsAgent.h"
+#include "webkit/api/public/WebPoint.h"
#include "webkit/api/public/WebString.h"
-#include "webkit/glue/webdevtoolsagent.h"
+using WebKit::WebDevToolsAgent;
+using WebKit::WebPoint;
using WebKit::WebString;
// static
@@ -28,7 +31,7 @@ DevToolsAgent::~DevToolsAgent() {
void DevToolsAgent::OnNavigate() {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->OnNavigate();
+ web_agent->didNavigate();
}
}
@@ -47,11 +50,11 @@ bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void DevToolsAgent::SendMessageToClient(const WebKit::WebString& class_name,
- const WebKit::WebString& method_name,
- const WebKit::WebString& param1,
- const WebKit::WebString& param2,
- const WebKit::WebString& param3) {
+void DevToolsAgent::sendMessageToFrontend(const WebString& class_name,
+ const WebString& method_name,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) {
IPC::Message* m = new ViewHostMsg_ForwardToDevToolsClient(
routing_id_,
DevToolsClientMsg_RpcMessage(
@@ -63,11 +66,11 @@ void DevToolsAgent::SendMessageToClient(const WebKit::WebString& class_name,
view_->Send(m);
}
-int DevToolsAgent::GetHostId() {
+int DevToolsAgent::hostIdentifier() {
return routing_id_;
}
-void DevToolsAgent::ForceRepaint() {
+void DevToolsAgent::forceRepaint() {
view_->GenerateFullRepaint();
}
@@ -84,14 +87,14 @@ DevToolsAgent* DevToolsAgent::FromHostId(int host_id) {
void DevToolsAgent::OnAttach() {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->Attach();
+ web_agent->attach();
}
}
void DevToolsAgent::OnDetach() {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->Detach();
+ web_agent->detach();
}
}
@@ -102,7 +105,7 @@ void DevToolsAgent::OnRpcMessage(const std::string& class_name,
const std::string& param3) {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->DispatchMessageFromClient(
+ web_agent->dispatchMessageFromFrontend(
WebString::fromUTF8(class_name),
WebString::fromUTF8(method_name),
WebString::fromUTF8(param1),
@@ -114,15 +117,15 @@ void DevToolsAgent::OnRpcMessage(const std::string& class_name,
void DevToolsAgent::OnInspectElement(int x, int y) {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->Attach();
- web_agent->InspectElement(x, y);
+ web_agent->attach();
+ web_agent->inspectElementAt(WebPoint(x, y));
}
}
void DevToolsAgent::OnSetApuAgentEnabled(bool enabled) {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->SetApuAgentEnabled(enabled);
+ web_agent->setApuAgentEnabled(enabled);
}
}
@@ -130,5 +133,5 @@ WebDevToolsAgent* DevToolsAgent::GetWebAgent() {
WebView* web_view = view_->webview();
if (!web_view)
return NULL;
- return web_view->GetWebDevToolsAgent();
+ return web_view->devToolsAgent();
}
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index eeae60a..2110841 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -8,20 +8,24 @@
#include <map>
#include <string>
-#include "webkit/glue/webdevtoolsagent_delegate.h"
+#include "base/basictypes.h"
+#include "webkit/api/public/WebDevToolsAgentClient.h"
namespace IPC {
class Message;
}
-class RenderView;
+namespace WebKit {
class WebDevToolsAgent;
+}
+
+class RenderView;
// DevToolsAgent belongs to the inspectable RenderView and provides Glue's
// agents with the communication capabilities. All messages from/to Glue's
// agents infrastructure are flowing through this comminucation agent.
// There is a corresponding DevToolsClient object on the client side.
-class DevToolsAgent : public WebDevToolsAgentDelegate {
+class DevToolsAgent : public WebKit::WebDevToolsAgentClient {
public:
DevToolsAgent(int routing_id, RenderView* view);
virtual ~DevToolsAgent();
@@ -31,21 +35,21 @@ class DevToolsAgent : public WebDevToolsAgentDelegate {
// IPC message interceptor. Called on the Render thread.
virtual bool OnMessageReceived(const IPC::Message& message);
- // WebDevToolsAgentDelegate implementation
- virtual void SendMessageToClient(const WebKit::WebString& class_name,
- const WebKit::WebString& method_name,
- const WebKit::WebString& param1,
- const WebKit::WebString& param2,
- const WebKit::WebString& param3);
- virtual int GetHostId();
- virtual void ForceRepaint();
+ // WebDevToolsAgentClient implementation
+ virtual void sendMessageToFrontend(const WebKit::WebString& class_name,
+ const WebKit::WebString& method_name,
+ const WebKit::WebString& param1,
+ const WebKit::WebString& param2,
+ const WebKit::WebString& param3);
+ virtual int hostIdentifier();
+ virtual void forceRepaint();
// Returns agent instance for its host id.
static DevToolsAgent* FromHostId(int host_id);
RenderView* render_view() { return view_; }
- WebDevToolsAgent* GetWebAgent();
+ WebKit::WebDevToolsAgent* GetWebAgent();
private:
friend class DevToolsAgentFilter;
diff --git a/chrome/renderer/devtools_agent_filter.cc b/chrome/renderer/devtools_agent_filter.cc
index 0c90491..8049868 100644
--- a/chrome/renderer/devtools_agent_filter.cc
+++ b/chrome/renderer/devtools_agent_filter.cc
@@ -9,9 +9,10 @@
#include "chrome/renderer/devtools_agent.h"
#include "chrome/renderer/plugin_channel_host.h"
#include "chrome/renderer/render_view.h"
+#include "webkit/api/public/WebDevToolsAgent.h"
#include "webkit/api/public/WebString.h"
-#include "webkit/glue/webdevtoolsagent.h"
+using WebKit::WebDevToolsAgent;
using WebKit::WebString;
// static
@@ -25,7 +26,7 @@ void DevToolsAgentFilter::DispatchMessageLoop() {
DevToolsAgentFilter::DevToolsAgentFilter()
: current_routing_id_(0) {
- WebDevToolsAgent::SetMessageLoopDispatchHandler(
+ WebDevToolsAgent::setMessageLoopDispatchHandler(
&DevToolsAgentFilter::DispatchMessageLoop);
}
@@ -48,6 +49,6 @@ bool DevToolsAgentFilter::OnMessageReceived(const IPC::Message& message) {
}
void DevToolsAgentFilter::OnDebuggerCommand(const std::string& command) {
- WebDevToolsAgent::ExecuteDebuggerCommand(
+ WebDevToolsAgent::executeDebuggerCommand(
WebString::fromUTF8(command), current_routing_id_);
}
diff --git a/chrome/renderer/devtools_agent_filter.h b/chrome/renderer/devtools_agent_filter.h
index c04a44a4..9ee6296 100644
--- a/chrome/renderer/devtools_agent_filter.h
+++ b/chrome/renderer/devtools_agent_filter.h
@@ -10,8 +10,6 @@
#include "ipc/ipc_channel_proxy.h"
-class WebDevToolsAgent;
-
// DevToolsAgentFilter is registered as an IPC filter in order to be able to
// dispatch messages while on the IO thread. The reason for that is that while
// debugging, Render thread is being held by the v8 and hence no messages
diff --git a/chrome/renderer/external_host_bindings.cc b/chrome/renderer/external_host_bindings.cc
index 70b867c..1ab3cc0 100644
--- a/chrome/renderer/external_host_bindings.cc
+++ b/chrome/renderer/external_host_bindings.cc
@@ -7,6 +7,7 @@
#include "base/values.h"
#include "chrome/common/render_messages.h"
#include "webkit/api/public/WebBindings.h"
+#include "webkit/api/public/WebFrame.h"
using WebKit::WebBindings;
diff --git a/chrome/renderer/notification_provider.cc b/chrome/renderer/notification_provider.cc
index 0c1b789..b439b60 100644
--- a/chrome/renderer/notification_provider.cc
+++ b/chrome/renderer/notification_provider.cc
@@ -8,6 +8,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h"
+#include "webkit/api/public/WebFrame.h"
#include "webkit/api/public/WebNotificationPermissionCallback.h"
using WebKit::WebNotification;
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 80b309f..1148ae4 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -208,6 +208,9 @@ class PrintWebViewHelper : public WebViewDelegate {
virtual void focusAccessibilityObject(
const WebKit::WebAccessibilityObject& object) {}
virtual void didUpdateInspectorSettings() {}
+ virtual WebKit::WebDevToolsAgentClient* devToolsAgentClient() {
+ return NULL;
+ }
virtual void queryAutofillSuggestions(
const WebKit::WebNode& node, const WebKit::WebString& name,
const WebKit::WebString& value) {}
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index d2130c6..24b6850 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -61,6 +61,7 @@
#include "skia/ext/image_operations.h"
#include "webkit/api/public/WebAccessibilityObject.h"
#include "webkit/api/public/WebDataSource.h"
+#include "webkit/api/public/WebDevToolsAgentClient.h"
#include "webkit/api/public/WebDragData.h"
#include "webkit/api/public/WebForm.h"
#include "webkit/api/public/WebFrame.h"
@@ -92,7 +93,6 @@
#include "webkit/glue/plugins/webplugin_delegate_pepper_impl.h"
#include "webkit/glue/searchable_form_data.h"
#include "webkit/glue/webaccessibilitymanager_impl.h"
-#include "webkit/glue/webdevtoolsagent_delegate.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webmediaplayer_impl.h"
@@ -120,6 +120,7 @@ using WebKit::WebConsoleMessage;
using WebKit::WebContextMenuData;
using WebKit::WebData;
using WebKit::WebDataSource;
+using WebKit::WebDevToolsAgentClient;
using WebKit::WebDragData;
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
@@ -1699,6 +1700,10 @@ void RenderView::didUpdateInspectorSettings() {
routing_id_, webview()->inspectorSettings().utf8()));
}
+WebDevToolsAgentClient* RenderView::devToolsAgentClient() {
+ return devtools_agent_.get();
+}
+
void RenderView::queryAutofillSuggestions(const WebNode& node,
const WebString& name,
const WebString& value) {
@@ -2809,10 +2814,6 @@ void RenderView::OnResetPageEncodingToDefault() {
webview()->setPageEncoding(no_encoding);
}
-WebDevToolsAgentDelegate* RenderView::GetWebDevToolsAgentDelegate() {
- return devtools_agent_.get();
-}
-
WebFrame* RenderView::GetChildFrame(const std::wstring& xpath) const {
if (xpath.empty())
return webview()->mainFrame();
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index ca7d38e..05eedff 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -67,7 +67,6 @@ class ListValue;
class NavigationState;
class PrintWebViewHelper;
class WebPluginDelegateProxy;
-class WebDevToolsAgentDelegate;
struct ContextMenuMediaParams;
struct ThumbnailScore;
struct ViewMsg_ClosePage_Params;
@@ -174,7 +173,6 @@ class RenderView : public RenderWidget,
virtual void OnMissingPluginStatus(
WebPluginDelegateProxy* delegate,
int status);
- virtual WebDevToolsAgentDelegate* GetWebDevToolsAgentDelegate();
virtual void UserMetricsRecordAction(const std::wstring& action);
virtual void DnsPrefetch(const std::vector<std::string>& host_names);
@@ -256,6 +254,7 @@ class RenderView : public RenderWidget,
virtual void focusAccessibilityObject(
const WebKit::WebAccessibilityObject& acc_obj);
virtual void didUpdateInspectorSettings();
+ virtual WebKit::WebDevToolsAgentClient* devToolsAgentClient();
virtual void queryAutofillSuggestions(
const WebKit::WebNode& node, const WebKit::WebString& name,
const WebKit::WebString& value);