diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-18 16:17:21 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-18 16:17:21 +0000 |
commit | 68b4d89935563f7009074cef5b7be8e0d8148bd4 (patch) | |
tree | f987689e2cc300230538482e7fa7b61b8dabd4bf /webkit | |
parent | daeb1b6db0ddff328b2ed4bc839a9f15936c3496 (diff) | |
download | chromium_src-68b4d89935563f7009074cef5b7be8e0d8148bd4.zip chromium_src-68b4d89935563f7009074cef5b7be8e0d8148bd4.tar.gz chromium_src-68b4d89935563f7009074cef5b7be8e0d8148bd4.tar.bz2 |
Create communication channel between developer tools UI implemented in JS and residing in a process different from inspected page renderer process. There is no direct IPC channel between the two processes so all messages are routed through browser process.
On the side of inspected page there is ToolsAgent existing in all renderers so that we can start inspecting the page at any moment by talking to this object.
On the side of developer tools renderer there is ToolsClient which is created only for RenderView that host developer tools UI.
This change is a slightly modified version of http://codereview.chromium.org/20221/show
Review URL: http://codereview.chromium.org/20430
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/glue.vcproj | 4 | ||||
-rw-r--r-- | webkit/glue/tools_proxy.h | 75 | ||||
-rw-r--r-- | webkit/glue/webview.h | 5 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 5 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 2 |
5 files changed, 91 insertions, 0 deletions
diff --git a/webkit/glue/glue.vcproj b/webkit/glue/glue.vcproj index acaad6f..1f7e9d7 100644 --- a/webkit/glue/glue.vcproj +++ b/webkit/glue/glue.vcproj @@ -173,6 +173,10 @@ > </File> <File + RelativePath=".\tools_proxy.h" + > + </File> + <File RelativePath=".\webdatasource.h" > </File> diff --git a/webkit/glue/tools_proxy.h b/webkit/glue/tools_proxy.h new file mode 100644 index 0000000..d4d70b5 --- /dev/null +++ b/webkit/glue/tools_proxy.h @@ -0,0 +1,75 @@ +// 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.
+
+// Developer tools consist of following parts:
+//
+// ToolsAgent lives in the renderer of an inspected page and provides access to
+// the pages resources, DOM, v8 etc. by means of IPC messages.
+//
+// ToolsClient is a thin delegate that lives in the tools front-end renderer and
+// converts IPC messages to frontend methods calls and allows the frontend to
+// send messages to the ToolsAgent.
+//
+// All the messages are routed through browser process.
+//
+// Chain of communication between the components may be described by the
+// following diagram:
+// --------------------------
+// | (tools frontend |
+// | renderer process) |
+// | | --------------------
+// |tools <--> ToolsClient+<-- IPC -->+ (browser process) |
+// |frontend | | |
+// -------------------------- -----------+--------
+// ^
+// |
+// IPC
+// |
+// v
+// --------------------------+-------
+// | inspected page <--> ToolsAgent |
+// | |
+// | (inspected page renderer process)|
+// ----------------------------------
+//
+// This file describes interface between tools frontend and ToolsClient in the
+// above diagram.
+
+#ifndef WEBKIT_GLUE_TOOLS_PROXY_H_
+#define WEBKIT_GLUE_TOOLS_PROXY_H_
+
+#include "base/basictypes.h"
+
+class ToolsUI;
+
+// Interface for sending messages to remote ToolsAgent.
+class ToolsProxy {
+ public:
+ ToolsProxy() {}
+ virtual ~ToolsProxy() {}
+
+ virtual void SetToolsUI(ToolsUI* tools_ui) = 0;
+
+ virtual void DebugAttach() = 0;
+ virtual void DebugDetach() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ToolsProxy);
+};
+
+
+// Interface for accessing tools frontend.
+class ToolsUI {
+ public:
+ ToolsUI() {}
+ virtual ~ToolsUI() {}
+
+ virtual void OnDidDebugAttach() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ToolsUI);
+};
+
+#endif // WEBKIT_GLUE_TOOLS_PROXY_H_
+
diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h index 39d608c..f0f3e26 100644 --- a/webkit/glue/webview.h +++ b/webkit/glue/webview.h @@ -12,6 +12,7 @@ #include "base/ref_counted.h" #include "webkit/glue/webwidget.h" +class ToolsProxy; struct WebDropData; struct WebPreferences; class GURL; @@ -165,6 +166,10 @@ class WebView : public WebWidget { // Show the JavaScript console. virtual void ShowJavaScriptConsole() = 0; + // Set up developer tools UI bindings. It is guaranteed that tools_proxy will + // overlive this webview. + virtual void SetUpToolsProxy(ToolsProxy* tools_proxy) = 0; + // Notifies the webview that a drag has terminated. virtual void DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y) = 0; diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 7959b6f..496aa7d 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1429,6 +1429,11 @@ void WebViewImpl::ShowJavaScriptConsole() { page_->inspectorController()->showPanel(InspectorController::ConsolePanel); } +void WebViewImpl::SetUpToolsProxy(ToolsProxy* tools_proxy) { + DCHECK(page_ != NULL); + // TODO(yurys): implement +} + void WebViewImpl::DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y) { PlatformMouseEvent pme(IntPoint(client_x, client_y), diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index c511e7b..ed0dbce 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -37,6 +37,7 @@ class Widget; class AutocompletePopupMenuClient; class ImageResourceFetcher; class SearchableFormData; +class ToolsProxy; struct WebDropData; class WebHistoryItemImpl; class WebKeyboardEvent; @@ -89,6 +90,7 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { virtual void CopyImageAt(int x, int y); virtual void InspectElement(int x, int y); virtual void ShowJavaScriptConsole(); + virtual void SetUpToolsProxy(ToolsProxy* tools_proxy); virtual void DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y); virtual void DragSourceMovedTo( |