summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 14:51:13 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 14:51:13 +0000
commit8ac0579d05bd06fa86842d79e5a7132f144976ce (patch)
tree8fd830e9664037b316f430014a0e3cfc2199cd2c /content
parentf5e44c2bc81566b6b813d4acd37cd2e838883718 (diff)
downloadchromium_src-8ac0579d05bd06fa86842d79e5a7132f144976ce.zip
chromium_src-8ac0579d05bd06fa86842d79e5a7132f144976ce.tar.gz
chromium_src-8ac0579d05bd06fa86842d79e5a7132f144976ce.tar.bz2
[Mac] Make detached DevTools window draggable by the titlebar - Chrome-side plumbing.
This depends on WebKit change: https://bugs.webkit.org/show_bug.cgi?id=71842 Also, sprinkle OVERRIDE all over devtools_client.h. BUG=44350 TEST=Open DevTools in undocked mode on the Mac. Drag the window by the empty space in the toolbar. The window should move. Review URL: http://codereview.chromium.org/8503022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/devtools_messages.h5
-rw-r--r--content/renderer/devtools_client.cc5
-rw-r--r--content/renderer/devtools_client.h28
3 files changed, 25 insertions, 13 deletions
diff --git a/content/common/devtools_messages.h b/content/common/devtools_messages.h
index 5c2af90..f8d9e16 100644
--- a/content/common/devtools_messages.h
+++ b/content/common/devtools_messages.h
@@ -131,6 +131,11 @@ IPC_MESSAGE_ROUTED0(DevToolsHostMsg_ActivateWindow)
// Closes dev tools window that is inspecting current render_view_host.
IPC_MESSAGE_ROUTED0(DevToolsHostMsg_CloseWindow)
+// Moves the corresponding dev tools window by the specified offset.
+IPC_MESSAGE_ROUTED2(DevToolsHostMsg_MoveWindow,
+ int /* x */,
+ int /* y */)
+
// Attaches dev tools window that is inspecting current render_view_host.
IPC_MESSAGE_ROUTED0(DevToolsHostMsg_RequestDockWindow)
diff --git a/content/renderer/devtools_client.cc b/content/renderer/devtools_client.cc
index 84b45aa..db44319 100644
--- a/content/renderer/devtools_client.cc
+++ b/content/renderer/devtools_client.cc
@@ -12,6 +12,7 @@
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFloatPoint.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "ui/base/ui_base_switches.h"
@@ -70,6 +71,10 @@ void DevToolsClient::closeWindow() {
Send(new DevToolsHostMsg_CloseWindow(routing_id()));
}
+void DevToolsClient::moveWindowBy(const WebKit::WebFloatPoint& offset) {
+ Send(new DevToolsHostMsg_MoveWindow(routing_id(), offset.x, offset.y));
+}
+
void DevToolsClient::requestDockWindow() {
Send(new DevToolsHostMsg_RequestDockWindow(routing_id()));
}
diff --git a/content/renderer/devtools_client.h b/content/renderer/devtools_client.h
index 7de4ea9..e88851e 100644
--- a/content/renderer/devtools_client.h
+++ b/content/renderer/devtools_client.h
@@ -37,21 +37,23 @@ class DevToolsClient : public content::RenderViewObserver,
private:
// RenderView::Observer implementation.
- virtual bool OnMessageReceived(const IPC::Message& message);
-
- // WebDevToolsFrontendClient implementation
- virtual void sendFrontendLoaded();
- virtual void sendMessageToBackend(const WebKit::WebString&);
- virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
-
- virtual void activateWindow();
- virtual void closeWindow();
- virtual void requestDockWindow();
- virtual void requestUndockWindow();
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // WebDevToolsFrontendClient implementation.
+ virtual void sendFrontendLoaded() OVERRIDE;
+ virtual void sendMessageToBackend(const WebKit::WebString&) OVERRIDE;
+ virtual void sendDebuggerCommandToAgent(
+ const WebKit::WebString& command) OVERRIDE;
+
+ virtual void activateWindow() OVERRIDE;
+ virtual void closeWindow() OVERRIDE;
+ virtual void moveWindowBy(const WebKit::WebFloatPoint& offset) OVERRIDE;
+ virtual void requestDockWindow() OVERRIDE;
+ virtual void requestUndockWindow() OVERRIDE;
virtual void saveAs(const WebKit::WebString& file_name,
- const WebKit::WebString& content);
+ const WebKit::WebString& content) OVERRIDE;
- virtual bool shouldHideScriptsPanel();
+ virtual bool shouldHideScriptsPanel() OVERRIDE;
void OnDispatchOnInspectorFrontend(const std::string& message);