summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger/devtools_client_host.h
diff options
context:
space:
mode:
authoryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-23 10:43:58 +0000
committeryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-23 10:43:58 +0000
commit7aa27fdf4e135daef7f49a37a61e506c165ce214 (patch)
tree20005ed71165173cd988d655a9534765439848ef /chrome/browser/debugger/devtools_client_host.h
parent7197f4999afa5e767fa9ed76fdc7e67db080f9d2 (diff)
downloadchromium_src-7aa27fdf4e135daef7f49a37a61e506c165ce214.zip
chromium_src-7aa27fdf4e135daef7f49a37a61e506c165ce214.tar.gz
chromium_src-7aa27fdf4e135daef7f49a37a61e506c165ce214.tar.bz2
Currently we have two types of devtools UI: Chrome built in developer tools window and remote debugger connected over TCP(apavlov is working on it). To allow DevToolsManager coordinate both types of devtools uniformly their API is extracted into DevToolsClientHost interface.
Fix purify errors in DevToolsManager unit tests. BUG=9150 Review URL: http://codereview.chromium.org/50009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger/devtools_client_host.h')
-rw-r--r--chrome/browser/debugger/devtools_client_host.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_client_host.h b/chrome/browser/debugger/devtools_client_host.h
new file mode 100644
index 0000000..71534fb
--- /dev/null
+++ b/chrome/browser/debugger/devtools_client_host.h
@@ -0,0 +1,62 @@
+// 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 CHROME_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_
+#define CHROME_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_
+
+#include "base/basictypes.h"
+
+namespace IPC {
+class Message;
+}
+
+class DevToolsWindow;
+
+// Describes interface for managing devtools clients from browser process. There
+// are currently two types of clients: devtools windows and TCP socket
+// debuggers.
+class DevToolsClientHost {
+ public:
+ class CloseListener {
+ public:
+ CloseListener() {}
+ virtual ~CloseListener() {}
+ virtual void ClientHostClosing(DevToolsClientHost* host) = 0;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CloseListener);
+ };
+
+ virtual ~DevToolsClientHost() {}
+
+ // This method is called when tab inspected by this devtools client is
+ // closing.
+ virtual void InspectedTabClosing() = 0;
+
+ // Sends the message to the devtools client hosted by this object.
+ virtual void SendMessageToClient(const IPC::Message& msg) = 0;
+
+ void set_close_listener(CloseListener* listener) {
+ close_listener_ = listener;
+ }
+
+ virtual DevToolsWindow* AsDevToolsWindow() { return NULL; }
+
+ protected:
+ DevToolsClientHost() : close_listener_(NULL) {}
+
+ // Should be called when the devtools client is going to die and this
+ // DevToolsClientHost should not be used anymore.
+ void NotifyCloseListener() {
+ if (close_listener_) {
+ close_listener_->ClientHostClosing(this);
+ close_listener_ = NULL;
+ }
+ }
+
+ private:
+ CloseListener* close_listener_;
+ DISALLOW_COPY_AND_ASSIGN(DevToolsClientHost);
+};
+
+#endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_