summaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--webkit/api/public/WebDevToolsAgent.h74
-rw-r--r--webkit/api/public/WebDevToolsAgentClient.h59
-rw-r--r--webkit/api/public/WebFrame.h2
-rw-r--r--webkit/api/public/WebView.h3
-rw-r--r--webkit/api/public/WebViewClient.h6
-rw-r--r--webkit/glue/devtools/debugger_agent_impl.h1
-rw-r--r--webkit/glue/devtools/debugger_agent_manager.cc3
-rw-r--r--webkit/glue/devtools/debugger_agent_manager.h6
-rw-r--r--webkit/glue/editor_client_impl.cc1
-rw-r--r--webkit/glue/mimetype_unittest.cc1
-rw-r--r--webkit/glue/webdevtoolsagent.h62
-rw-r--r--webkit/glue/webdevtoolsagent_delegate.h35
-rw-r--r--webkit/glue/webdevtoolsagent_impl.cc79
-rw-r--r--webkit/glue/webdevtoolsagent_impl.h36
-rw-r--r--webkit/glue/webview.h17
-rw-r--r--webkit/glue/webview_delegate.h31
-rw-r--r--webkit/glue/webview_impl.cc25
-rw-r--r--webkit/glue/webview_impl.h7
-rw-r--r--webkit/tools/test_shell/mac/test_shell_webview.mm1
-rw-r--r--webkit/tools/test_shell/test_shell.h1
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc1
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm1
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h3
-rw-r--r--webkit/webkit.gyp4
33 files changed, 279 insertions, 271 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);
diff --git a/webkit/api/public/WebDevToolsAgent.h b/webkit/api/public/WebDevToolsAgent.h
new file mode 100644
index 0000000..4ae1077
--- /dev/null
+++ b/webkit/api/public/WebDevToolsAgent.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDevToolsAgent_h
+#define WebDevToolsAgent_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+class WebString;
+struct WebPoint;
+
+class WebDevToolsAgent {
+public:
+ virtual void attach() = 0;
+ virtual void detach() = 0;
+
+ virtual void didNavigate() = 0;
+
+ virtual void dispatchMessageFromFrontend(const WebString& className,
+ const WebString& methodName,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) = 0;
+
+ virtual void inspectElementAt(const WebPoint&) = 0;
+
+ virtual void setApuAgentEnabled(bool enabled) = 0;
+
+ // Asynchronously executes debugger command in the render thread.
+ // |caller_id| will be used for sending response.
+ WEBKIT_API static void executeDebuggerCommand(
+ const WebString& command, int callerIdentifier);
+
+ typedef void (*MessageLoopDispatchHandler)();
+
+ // Installs dispatch handle that is going to be called periodically
+ // while on a breakpoint.
+ static void setMessageLoopDispatchHandler(MessageLoopDispatchHandler);
+
+protected:
+ ~WebDevToolsAgent() {}
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/webkit/api/public/WebDevToolsAgentClient.h b/webkit/api/public/WebDevToolsAgentClient.h
new file mode 100644
index 0000000..4cb01d6
--- /dev/null
+++ b/webkit/api/public/WebDevToolsAgentClient.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDevToolsAgentClient_h
+#define WebDevToolsAgentClient_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+class WebString;
+
+class WebDevToolsAgentClient {
+public:
+ virtual void sendMessageToFrontend(const WebString& className,
+ const WebString& methodName,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) = 0;
+
+ // Invalidates widget which leads to the repaint.
+ virtual void forceRepaint() = 0;
+
+ // Returns the identifier of the entity hosting this agent.
+ virtual int hostIdentifier() = 0;
+
+protected:
+ ~WebDevToolsAgentClient() {}
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/webkit/api/public/WebFrame.h b/webkit/api/public/WebFrame.h
index 671c550..1306b97 100644
--- a/webkit/api/public/WebFrame.h
+++ b/webkit/api/public/WebFrame.h
@@ -123,7 +123,7 @@ namespace WebKit {
// Hierarchy ----------------------------------------------------------
// Returns the containing view.
- virtual WebView* view() const = 0;
+ virtual ::WebView* view() const = 0;
// Returns the frame that opened this frame or 0 if there is none.
virtual WebFrame* opener() const = 0;
diff --git a/webkit/api/public/WebView.h b/webkit/api/public/WebView.h
index a886424..328d03a 100644
--- a/webkit/api/public/WebView.h
+++ b/webkit/api/public/WebView.h
@@ -36,6 +36,7 @@
namespace WebKit {
class WebAccessibilityObject;
+ class WebDevToolsAgent;
class WebDragData;
class WebFrame;
class WebFrameClient;
@@ -203,6 +204,8 @@ namespace WebKit {
virtual WebString inspectorSettings() const = 0;
virtual void setInspectorSettings(const WebString&) = 0;
+ virtual WebDevToolsAgent* devToolsAgent() = 0;
+
// Accessibility -------------------------------------------------------
diff --git a/webkit/api/public/WebViewClient.h b/webkit/api/public/WebViewClient.h
index 725d785..054a747 100644
--- a/webkit/api/public/WebViewClient.h
+++ b/webkit/api/public/WebViewClient.h
@@ -35,12 +35,14 @@
#include "WebEditingAction.h"
#include "WebFileChooserCompletion.h"
#include "WebTextAffinity.h"
+#include "WebTextDirection.h"
#include "WebWidgetClient.h"
class WebView; // FIXME: Move into the WebKit namespace.
namespace WebKit {
class WebAccessibilityObject;
+ class WebDevToolsAgentClient;
class WebDragData;
class WebFileChooserCompletion;
class WebFrame;
@@ -48,6 +50,7 @@ namespace WebKit {
class WebNotificationPresenter;
class WebRange;
class WebString;
+ class WebURL;
class WebWidget;
struct WebConsoleMessage;
struct WebContextMenuData;
@@ -245,12 +248,15 @@ namespace WebKit {
// accessibility object.
virtual void focusAccessibilityObject(const WebAccessibilityObject&) = 0;
+
// Developer tools -----------------------------------------------------
// Called to notify the client that the inspector's settings were
// changed and should be saved. See WebView::inspectorSettings.
virtual void didUpdateInspectorSettings() = 0;
+ virtual WebDevToolsAgentClient* devToolsAgentClient() = 0;
+
// Autofill ------------------------------------------------------------
diff --git a/webkit/glue/devtools/debugger_agent_impl.h b/webkit/glue/devtools/debugger_agent_impl.h
index 1695775..ebc78cc 100644
--- a/webkit/glue/devtools/debugger_agent_impl.h
+++ b/webkit/glue/devtools/debugger_agent_impl.h
@@ -9,7 +9,6 @@
#include "v8.h"
#include "webkit/glue/devtools/debugger_agent.h"
-#include "webkit/glue/webdevtoolsagent.h"
class WebDevToolsAgentImpl;
class WebViewImpl;
diff --git a/webkit/glue/devtools/debugger_agent_manager.cc b/webkit/glue/devtools/debugger_agent_manager.cc
index d390f12..a905766 100644
--- a/webkit/glue/devtools/debugger_agent_manager.cc
+++ b/webkit/glue/devtools/debugger_agent_manager.cc
@@ -11,6 +11,7 @@
#undef LOG
#include "base/string_util.h"
+#include "webkit/api/public/WebDevToolsAgent.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
#include "webkit/glue/webdevtoolsagent_impl.h"
@@ -20,6 +21,8 @@
#include "v8/include/v8-debug.h"
#endif
+using WebKit::WebDevToolsAgent;
+
WebDevToolsAgent::MessageLoopDispatchHandler
DebuggerAgentManager::message_loop_dispatch_handler_ = NULL;
diff --git a/webkit/glue/devtools/debugger_agent_manager.h b/webkit/glue/devtools/debugger_agent_manager.h
index 3ec5561..b81ed76 100644
--- a/webkit/glue/devtools/debugger_agent_manager.h
+++ b/webkit/glue/devtools/debugger_agent_manager.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "v8/include/v8-debug.h"
-#include "webkit/glue/webdevtoolsagent.h"
+#include "webkit/api/public/WebDevToolsAgent.h"
namespace WebCore {
class PageGroupLoadDeferrer;
@@ -43,7 +43,7 @@ class DebuggerAgentManager {
static void ExecuteDebuggerCommand(const WebCore::String& command,
int caller_id);
static void SetMessageLoopDispatchHandler(
- WebDevToolsAgent::MessageLoopDispatchHandler handler);
+ WebKit::WebDevToolsAgent::MessageLoopDispatchHandler handler);
// Sets |host_id| as the frame context data. This id is used to filter scripts
// related to the inspected page.
@@ -86,7 +86,7 @@ class DebuggerAgentManager {
typedef HashMap<int, DebuggerAgentImpl*> AttachedAgentsMap;
static AttachedAgentsMap* attached_agents_map_;
- static WebDevToolsAgent::MessageLoopDispatchHandler
+ static WebKit::WebDevToolsAgent::MessageLoopDispatchHandler
message_loop_dispatch_handler_;
static bool in_host_dispatch_handler_;
typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*>
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc
index 6ea16db..bbcadc46 100644
--- a/webkit/glue/editor_client_impl.cc
+++ b/webkit/glue/editor_client_impl.cc
@@ -32,7 +32,6 @@
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/editor_client_impl.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webview.h"
#include "webkit/glue/webview_impl.h"
diff --git a/webkit/glue/mimetype_unittest.cc b/webkit/glue/mimetype_unittest.cc
index 46757f2..36a59dd 100644
--- a/webkit/glue/mimetype_unittest.cc
+++ b/webkit/glue/mimetype_unittest.cc
@@ -10,6 +10,7 @@
#include "base/string_util.h"
#include "net/url_request/url_request_unittest.h"
+#include "webkit/api/public/WebFrame.h"
#include "webkit/glue/unittest_test_server.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webview.h"
diff --git a/webkit/glue/webdevtoolsagent.h b/webkit/glue/webdevtoolsagent.h
deleted file mode 100644
index 8186051..0000000
--- a/webkit/glue/webdevtoolsagent.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_
-#define WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_
-
-#include "base/basictypes.h"
-
-namespace WebKit {
-class WebString;
-}
-
-// WebDevToolsAgent represents DevTools agent sitting in the Glue. It provides
-// direct and delegate Apis to the host.
-class WebDevToolsAgent {
- public:
- class Message {
- public:
- Message() {}
- virtual ~Message() {}
- virtual void Dispatch() = 0;
- private:
- DISALLOW_COPY_AND_ASSIGN(Message);
- };
-
- WebDevToolsAgent() {}
- virtual ~WebDevToolsAgent() {}
-
- virtual void Attach() = 0;
-
- virtual void Detach() = 0;
-
- virtual void OnNavigate() = 0;
-
- virtual void DispatchMessageFromClient(const WebKit::WebString& class_name,
- const WebKit::WebString& method_name,
- const WebKit::WebString& param1,
- const WebKit::WebString& param2,
- const WebKit::WebString& param3) = 0;
-
- virtual void InspectElement(int x, int y) = 0;
-
- virtual void SetApuAgentEnabled(bool enabled) = 0;
-
- // Asynchronously executes debugger command in the render thread.
- // |caller_id| will be used for sending response.
- static void ExecuteDebuggerCommand(const WebKit::WebString& command,
- int caller_id);
-
- typedef void (*MessageLoopDispatchHandler)();
-
- // Installs dispatch handle that is going to be called periodically
- // while on a breakpoint.
- static void SetMessageLoopDispatchHandler(
- MessageLoopDispatchHandler handler);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgent);
-};
-
-#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_
diff --git a/webkit/glue/webdevtoolsagent_delegate.h b/webkit/glue/webdevtoolsagent_delegate.h
deleted file mode 100644
index 1e34fb7..0000000
--- a/webkit/glue/webdevtoolsagent_delegate.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_DELEGATE_H_
-#define WEBKIT_GLUE_WEBDEVTOOLSAGENT_DELEGATE_H_
-
-#include "base/basictypes.h"
-
-namespace WebKit {
-class WebString;
-}
-
-class WebDevToolsAgentDelegate {
- public:
- WebDevToolsAgentDelegate() {}
- virtual ~WebDevToolsAgentDelegate() {}
-
- 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) = 0;
-
- // Invalidates widget which leads to the repaint.
- virtual void ForceRepaint() = 0;
-
- // Returns the id of the entity hosting this agent.
- virtual int GetHostId() = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentDelegate);
-};
-
-#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_DELEGATE_H_
diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc
index e255b39..ae320c5 100644
--- a/webkit/glue/webdevtoolsagent_impl.cc
+++ b/webkit/glue/webdevtoolsagent_impl.cc
@@ -25,13 +25,13 @@
#undef LOG
#include "webkit/api/public/WebDataSource.h"
+#include "webkit/api/public/WebDevToolsAgentClient.h"
#include "webkit/api/public/WebURL.h"
#include "webkit/api/public/WebURLRequest.h"
#include "webkit/glue/devtools/bound_object.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/webdevtoolsagent_delegate.h"
#include "webkit/glue/webdevtoolsagent_impl.h"
#include "webkit/glue/webview_impl.h"
@@ -51,7 +51,9 @@ using WebCore::V8ClassIndex;
using WebCore::V8DOMWrapper;
using WebCore::V8Proxy;
using WebKit::WebDataSource;
+using WebKit::WebDevToolsAgentClient;
using WebKit::WebFrame;
+using WebKit::WebPoint;
using WebKit::WebString;
using WebKit::WebURL;
using WebKit::WebURLRequest;
@@ -81,9 +83,9 @@ void SetApuAgentEnabledInUtilityContext(v8::Handle<v8::Context> context,
WebDevToolsAgentImpl::WebDevToolsAgentImpl(
WebViewImpl* web_view_impl,
- WebDevToolsAgentDelegate* delegate)
- : host_id_(delegate->GetHostId()),
- delegate_(delegate),
+ WebDevToolsAgentClient* client)
+ : host_id_(client->hostIdentifier()),
+ client_(client),
web_view_impl_(web_view_impl),
apu_agent_enabled_(false),
resource_tracking_was_enabled_(false),
@@ -114,7 +116,7 @@ void WebDevToolsAgentImpl::UnhideResourcesPanelIfNecessary() {
tools_agent_delegate_stub_->DispatchOnClient(command);
}
-void WebDevToolsAgentImpl::Attach() {
+void WebDevToolsAgentImpl::attach() {
if (attached_) {
return;
}
@@ -130,7 +132,7 @@ void WebDevToolsAgentImpl::Attach() {
attached_ = true;
}
-void WebDevToolsAgentImpl::Detach() {
+void WebDevToolsAgentImpl::detach() {
// Prevent controller from sending messages to the frontend.
InspectorController* ic = web_view_impl_->page()->inspectorController();
ic->hideHighlight();
@@ -142,7 +144,7 @@ void WebDevToolsAgentImpl::Detach() {
attached_ = false;
}
-void WebDevToolsAgentImpl::OnNavigate() {
+void WebDevToolsAgentImpl::didNavigate() {
DebuggerAgentManager::OnNavigate();
}
@@ -176,7 +178,7 @@ void WebDevToolsAgentImpl::WindowObjectCleared(WebFrameImpl* webframe) {
}
void WebDevToolsAgentImpl::ForceRepaint() {
- delegate_->ForceRepaint();
+ client_->forceRepaint();
}
void WebDevToolsAgentImpl::DispatchOnInspectorController(
@@ -230,28 +232,7 @@ void WebDevToolsAgentImpl::GetResourceContent(
tools_agent_native_delegate_stub_->DidGetResourceContent(call_id, content);
}
-void WebDevToolsAgentImpl::SetApuAgentEnabled(bool enable) {
- apu_agent_enabled_ = enable;
- SetApuAgentEnabledInUtilityContext(utility_context_, enable);
- InspectorController* ic = web_view_impl_->page()->inspectorController();
- if (enable) {
- resource_tracking_was_enabled_ = ic->resourceTrackingEnabled();
- ic->startTimelineProfiler();
- if (!resource_tracking_was_enabled_) {
- // TODO(knorton): Introduce some kind of agents dependency here so that
- // user could turn off resource tracking while apu agent is on.
- ic->enableResourceTracking(false);
- }
- } else {
- ic->stopTimelineProfiler();
- if (!resource_tracking_was_enabled_) {
- ic->disableResourceTracking(false);
- }
- resource_tracking_was_enabled_ = false;
- }
-}
-
-void WebDevToolsAgentImpl::DispatchMessageFromClient(
+void WebDevToolsAgentImpl::dispatchMessageFromFrontend(
const WebString& class_name,
const WebString& method_name,
const WebString& param1,
@@ -283,13 +264,29 @@ void WebDevToolsAgentImpl::DispatchMessageFromClient(
}
}
-void WebDevToolsAgentImpl::InspectElement(int x, int y) {
- Node* node = web_view_impl_->GetNodeForWindowPos(x, y);
- if (!node) {
- return;
- }
+void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) {
+ web_view_impl_->inspectElementAt(point);
+}
+
+void WebDevToolsAgentImpl::setApuAgentEnabled(bool enable) {
+ apu_agent_enabled_ = enable;
+ SetApuAgentEnabledInUtilityContext(utility_context_, enable);
InspectorController* ic = web_view_impl_->page()->inspectorController();
- ic->inspect(node);
+ if (enable) {
+ resource_tracking_was_enabled_ = ic->resourceTrackingEnabled();
+ ic->startTimelineProfiler();
+ if (!resource_tracking_was_enabled_) {
+ // TODO(knorton): Introduce some kind of agents dependency here so that
+ // user could turn off resource tracking while apu agent is on.
+ ic->enableResourceTracking(false);
+ }
+ } else {
+ ic->stopTimelineProfiler();
+ if (!resource_tracking_was_enabled_) {
+ ic->disableResourceTracking(false);
+ }
+ resource_tracking_was_enabled_ = false;
+ }
}
void WebDevToolsAgentImpl::SendRpcMessage(
@@ -298,7 +295,7 @@ void WebDevToolsAgentImpl::SendRpcMessage(
const String& param1,
const String& param2,
const String& param3) {
- delegate_->SendMessageToClient(
+ client_->sendMessageToFrontend(
webkit_glue::StringToWebString(class_name),
webkit_glue::StringToWebString(method_name),
webkit_glue::StringToWebString(param1),
@@ -407,8 +404,10 @@ v8::Handle<v8::Value> WebDevToolsAgentImpl::JsDispatchToApu(
return v8::Undefined();
}
+namespace WebKit {
+
// static
-void WebDevToolsAgent::ExecuteDebuggerCommand(
+void WebDevToolsAgent::executeDebuggerCommand(
const WebString& command,
int caller_id) {
DebuggerAgentManager::ExecuteDebuggerCommand(
@@ -416,7 +415,9 @@ void WebDevToolsAgent::ExecuteDebuggerCommand(
}
// static
-void WebDevToolsAgent::SetMessageLoopDispatchHandler(
+void WebDevToolsAgent::setMessageLoopDispatchHandler(
MessageLoopDispatchHandler handler) {
DebuggerAgentManager::SetMessageLoopDispatchHandler(handler);
}
+
+} // namespace WebKit
diff --git a/webkit/glue/webdevtoolsagent_impl.h b/webkit/glue/webdevtoolsagent_impl.h
index f0fb56e..98c4f25 100644
--- a/webkit/glue/webdevtoolsagent_impl.h
+++ b/webkit/glue/webdevtoolsagent_impl.h
@@ -10,10 +10,10 @@
#include <wtf/OwnPtr.h>
#include "v8.h"
+#include "webkit/api/public/WebDevToolsAgent.h"
#include "webkit/glue/devtools/devtools_rpc.h"
#include "webkit/glue/devtools/apu_agent_delegate.h"
#include "webkit/glue/devtools/tools_agent.h"
-#include "webkit/glue/webdevtoolsagent.h"
namespace WebCore {
class Document;
@@ -23,6 +23,7 @@ class String;
}
namespace WebKit {
+class WebDevToolsAgentClient;
class WebFrame;
}
@@ -30,17 +31,15 @@ class BoundObject;
class DebuggerAgentDelegateStub;
class DebuggerAgentImpl;
class Value;
-class WebDevToolsAgentDelegate;
class WebFrameImpl;
class WebViewImpl;
-class WebDevToolsAgentImpl
- : public WebDevToolsAgent,
- public ToolsAgent,
- public DevToolsRpc::Delegate {
+class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgent,
+ public ToolsAgent,
+ public DevToolsRpc::Delegate {
public:
WebDevToolsAgentImpl(WebViewImpl* web_view_impl,
- WebDevToolsAgentDelegate* delegate);
+ WebKit::WebDevToolsAgentClient* client);
virtual ~WebDevToolsAgentImpl();
// ToolsAgent implementation.
@@ -56,18 +55,19 @@ class WebDevToolsAgentImpl
virtual void GetResourceContent(
int call_id,
int identifier);
- virtual void SetApuAgentEnabled(bool enable);
// WebDevToolsAgent implementation.
- virtual void Attach();
- virtual void Detach();
- virtual void OnNavigate();
- virtual void DispatchMessageFromClient(const WebKit::WebString& class_name,
- const WebKit::WebString& method_name,
- const WebKit::WebString& param1,
- const WebKit::WebString& param2,
- const WebKit::WebString& param3);
- virtual void InspectElement(int x, int y);
+ virtual void attach();
+ virtual void detach();
+ virtual void didNavigate();
+ virtual void dispatchMessageFromFrontend(
+ const WebKit::WebString& class_name,
+ const WebKit::WebString& method_name,
+ const WebKit::WebString& param1,
+ const WebKit::WebString& param2,
+ const WebKit::WebString& param3);
+ virtual void inspectElementAt(const WebKit::WebPoint& point);
+ virtual void setApuAgentEnabled(bool enable);
// DevToolsRpc::Delegate implementation.
void SendRpcMessage(const WebCore::String& class_name,
@@ -104,7 +104,7 @@ class WebDevToolsAgentImpl
v8::Local<v8::Object> CreateInspectorBackendV8Wrapper();
int host_id_;
- WebDevToolsAgentDelegate* delegate_;
+ WebKit::WebDevToolsAgentClient* client_;
WebViewImpl* web_view_impl_;
OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_;
OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_;
diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h
index 036e5a3..765b6f4 100644
--- a/webkit/glue/webview.h
+++ b/webkit/glue/webview.h
@@ -5,23 +5,9 @@
#ifndef WEBKIT_GLUE_WEBVIEW_H_
#define WEBKIT_GLUE_WEBVIEW_H_
-#include <string>
-#include <vector>
-
#include "base/basictypes.h"
-#include "webkit/api/public/WebDragOperation.h"
#include "webkit/api/public/WebView.h"
-namespace WebKit {
-class WebDragData;
-class WebFrameClient;
-class WebFrame;
-class WebSettings;
-struct WebPoint;
-}
-
-class GURL;
-class WebDevToolsAgent;
class WebViewDelegate;
//
@@ -63,9 +49,6 @@ class WebView : public WebKit::WebView {
// links.
static void ResetVisitedLinkState();
- // Returns development tools agent instance belonging to this view.
- virtual WebDevToolsAgent* GetWebDevToolsAgent() = 0;
-
private:
DISALLOW_COPY_AND_ASSIGN(WebView);
};
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index c647e7c..5c9e3d7 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -26,41 +26,10 @@
#ifndef WEBKIT_GLUE_WEBVIEW_DELEGATE_H_
#define WEBKIT_GLUE_WEBVIEW_DELEGATE_H_
-#include <vector>
-
-#include "webkit/api/public/WebDragOperation.h"
-#include "webkit/api/public/WebFrame.h"
-#include "webkit/api/public/WebTextDirection.h"
#include "webkit/api/public/WebViewClient.h"
-#include "webkit/glue/context_menu.h"
-
-namespace WebCore {
-class AccessibilityObject;
-}
-
-namespace WebKit {
-class WebDragData;
-class WebNotificationPresenter;
-class WebWidget;
-struct WebPopupMenuInfo;
-struct WebPoint;
-struct WebRect;
-}
-
-class FilePath;
-class SkBitmap;
-class WebDevToolsAgentDelegate;
-class WebView;
// TODO(darin): Eliminate WebViewDelegate in favor of WebViewClient.
class WebViewDelegate : public WebKit::WebViewClient {
- public:
- // DevTools ----------------------------------------------------------------
-
- virtual WebDevToolsAgentDelegate* GetWebDevToolsAgentDelegate() {
- return NULL;
- }
-
protected:
~WebViewDelegate() { }
};
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 91021f2..5c9b322 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -80,7 +80,6 @@ MSVC_POP_WARNING();
#include "webkit/glue/webdevtoolsagent_impl.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webpopupmenu_impl.h"
-#include "webkit/glue/webdevtoolsagent.h"
#include "webkit/glue/webdevtoolsclient.h"
#include "webkit/glue/webview_delegate.h"
#include "webkit/glue/webview_impl.h"
@@ -99,6 +98,8 @@ using WebKit::WebCanvas;
using WebKit::WebCompositionCommand;
using WebKit::WebCompositionCommandConfirm;
using WebKit::WebCompositionCommandDiscard;
+using WebKit::WebDevToolsAgent;
+using WebKit::WebDevToolsAgentClient;
using WebKit::WebDragData;
using WebKit::WebDragOperation;
using WebKit::WebDragOperationCopy;
@@ -354,11 +355,10 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frame_client) {
main_frame->InitMainFrame(this);
- if (delegate_) {
- WebDevToolsAgentDelegate* tools_delegate =
- delegate_->GetWebDevToolsAgentDelegate();
- if (tools_delegate)
- devtools_agent_.reset(new WebDevToolsAgentImpl(this, tools_delegate));
+ if (client()) {
+ WebDevToolsAgentClient* tools_client = client()->devToolsAgentClient();
+ if (tools_client)
+ devtools_agent_.reset(new WebDevToolsAgentImpl(this, tools_client));
}
// Restrict the access to the local file system
@@ -1665,6 +1665,10 @@ void WebViewImpl::setInspectorSettings(const WebString& settings) {
inspector_settings_ = settings;
}
+WebDevToolsAgent* WebViewImpl::devToolsAgent() {
+ return devtools_agent_.get();
+}
+
WebAccessibilityObject WebViewImpl::accessibilityObject() {
if (!main_frame())
return WebAccessibilityObject();
@@ -1751,10 +1755,6 @@ bool WebViewImpl::setDropEffect(bool accept) {
}
}
-WebDevToolsAgent* WebViewImpl::GetWebDevToolsAgent() {
- return GetWebDevToolsAgentImpl();
-}
-
WebDevToolsAgentImpl* WebViewImpl::GetWebDevToolsAgentImpl() {
return devtools_agent_.get();
}
@@ -1869,11 +1869,6 @@ void WebViewImpl::SetIgnoreInputEvents(bool new_value) {
ignore_input_events_ = new_value;
}
-WebCore::Node* WebViewImpl::GetNodeForWindowPos(int x, int y) {
- HitTestResult result = HitTestResultForWindowPos(IntPoint(x, y));
- return result.innerNonSharedNode();
-}
-
#if ENABLE(NOTIFICATIONS)
WebKit::NotificationPresenterImpl* WebViewImpl::GetNotificationPresenter() {
if (!notification_presenter_.isInitialized() && client())
diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h
index eeb1d89..35eaf44 100644
--- a/webkit/glue/webview_impl.h
+++ b/webkit/glue/webview_impl.h
@@ -57,7 +57,6 @@ class ImageResourceFetcher;
class AutocompletePopupMenuClient;
class SearchableFormData;
class WebHistoryItemImpl;
-class WebDevToolsAgent;
class WebDevToolsAgentImpl;
class WebViewDelegate;
@@ -137,6 +136,7 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
virtual void inspectElementAt(const WebKit::WebPoint& point);
virtual WebKit::WebString inspectorSettings() const;
virtual void setInspectorSettings(const WebKit::WebString& settings);
+ virtual WebKit::WebDevToolsAgent* devToolsAgent();
virtual WebKit::WebAccessibilityObject accessibilityObject();
virtual void applyAutofillSuggestions(
const WebKit::WebNode&,
@@ -146,7 +146,6 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
// WebView methods:
virtual void SetIgnoreInputEvents(bool new_value);
- virtual WebDevToolsAgent* GetWebDevToolsAgent();
WebDevToolsAgentImpl* GetWebDevToolsAgentImpl();
// WebViewImpl
@@ -247,10 +246,6 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
void HideAutoCompletePopup();
void AutoCompletePopupDidHide();
- // Converts |x|, |y| from window coordinates to contents coordinates and gets
- // the underlying Node for them.
- WebCore::Node* GetNodeForWindowPos(int x, int y);
-
#if ENABLE(NOTIFICATIONS)
// Returns the provider of desktop notifications.
WebKit::NotificationPresenterImpl* GetNotificationPresenter();
diff --git a/webkit/tools/test_shell/mac/test_shell_webview.mm b/webkit/tools/test_shell/mac/test_shell_webview.mm
index 908abde..251e8b6 100644
--- a/webkit/tools/test_shell/mac/test_shell_webview.mm
+++ b/webkit/tools/test_shell/mac/test_shell_webview.mm
@@ -9,6 +9,7 @@
#include "base/gfx/rect.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "webkit/api/public/WebFrame.h"
#include "webkit/glue/webview.h"
#include "webkit/tools/test_shell/test_shell.h"
#include "webkit/tools/test_shell/webwidget_host.h"
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index dfe64b3..d50aa80 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -48,6 +48,7 @@ typedef std::list<gfx::NativeWindow> WindowList;
struct WebPreferences;
class AccessibilityController;
+class FilePath;
class TestNavigationEntry;
class TestNavigationController;
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 5a7b4e8..9b50e24 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -23,6 +23,7 @@
#include "grit/webkit_resources.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
+#include "webkit/api/public/WebFrame.h"
#include "webkit/api/public/WebPoint.h"
#include "webkit/glue/plugins/plugin_list.h"
#include "webkit/glue/resource_loader_bridge.h"
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index afe59b3..d67eb38 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -28,6 +28,7 @@
#include "net/base/mime_util.h"
#include "skia/ext/bitmap_platform_device.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/api/public/WebFrame.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/webview.h"
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index 120c59f..ad82a4a 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -142,6 +142,9 @@ class TestWebViewDelegate : public WebViewDelegate,
virtual void focusAccessibilityObject(
const WebKit::WebAccessibilityObject& object);
virtual void didUpdateInspectorSettings() {}
+ virtual WebKit::WebDevToolsAgentClient* devToolsAgentClient() {
+ return NULL;
+ }
virtual void queryAutofillSuggestions(
const WebKit::WebNode&, const WebKit::WebString& name,
const WebKit::WebString& value) {}
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 9aed9ec..2bcc616 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -94,6 +94,8 @@
'api/public/WebCursorInfo.h',
'api/public/WebData.h',
'api/public/WebDataSource.h',
+ 'api/public/WebDevToolsAgent.h',
+ 'api/public/WebDevToolsAgentClient.h',
'api/public/WebDragData.h',
'api/public/WebEditingAction.h',
'api/public/WebFileChooserCompletion.h',
@@ -612,8 +614,6 @@
'glue/webcursor_gtk_data.h',
'glue/webcursor_mac.mm',
'glue/webcursor_win.cc',
- 'glue/webdevtoolsagent.h',
- 'glue/webdevtoolsagent_delegate.h',
'glue/webdevtoolsagent_impl.cc',
'glue/webdevtoolsagent_impl.h',
'glue/webdevtoolsclient.h',