Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: content/public/browser/devtools_client_host.h

Issue 8549022: Define DevTools content API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jam's comments addressed Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/devtools_client_host.h
diff --git a/content/browser/debugger/devtools_client_host.h b/content/public/browser/devtools_client_host.h
similarity index 50%
rename from content/browser/debugger/devtools_client_host.h
rename to content/public/browser/devtools_client_host.h
index 0ae8c1b9094b0cf2ca2673f15468b7a7aeba8f43..8bd98e8889a4792033e396812684a30808fbf2de 100644
--- a/content/browser/debugger/devtools_client_host.h
+++ b/content/public/browser/devtools_client_host.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_
-#define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_
+#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_
+#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_
#pragma once
#include <string>
@@ -15,23 +15,22 @@ namespace IPC {
class Message;
}
+class RenderViewHost;
class TabContents;
+namespace content {
+
+class DevToolsFrontendHostDelegate;
+
// Describes interface for managing devtools clients from browser process. There
// are currently two types of clients: devtools windows and TCP socket
// debuggers.
class CONTENT_EXPORT DevToolsClientHost {
public:
- class CONTENT_EXPORT CloseListener {
- public:
- CloseListener() {}
- virtual ~CloseListener() {}
- virtual void ClientHostClosing(DevToolsClientHost* host) = 0;
- private:
- DISALLOW_COPY_AND_ASSIGN(CloseListener);
- };
+ virtual ~DevToolsClientHost() {}
- virtual ~DevToolsClientHost();
+ // Dispatches given message on the front-end.
+ virtual void DispatchOnInspectorFrontend(const std::string& message) = 0;
// This method is called when tab inspected by this devtools client is
// closing.
@@ -41,29 +40,20 @@ class CONTENT_EXPORT DevToolsClientHost {
// navigating to |url|.
virtual void FrameNavigating(const std::string& url) = 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;
- }
-
// Invoked when a tab is replaced by another tab. This is triggered by
// TabStripModel::ReplaceTabContentsAt.
virtual void TabReplaced(TabContents* new_tab) = 0;
- protected:
- DevToolsClientHost();
+ // Creates DevToolsClientHost for TabContents containing default DevTools
+ // frontend implementation.
+ static DevToolsClientHost* CreateDevToolsFrontendHost(
+ TabContents* client_tab_contents,
+ DevToolsFrontendHostDelegate* delegate);
- void ForwardToDevToolsAgent(const IPC::Message& message);
-
- // Should be called when the devtools client is going to die and this
- // DevToolsClientHost should not be used anymore.
- void NotifyCloseListener();
-
- private:
- CloseListener* close_listener_;
- DISALLOW_COPY_AND_ASSIGN(DevToolsClientHost);
+ // Sets up DevToolsClient on the corresponding RenderView.
+ static void SetupDevToolsFrontendClient(RenderViewHost* frontend_rvh);
};
-#endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_CLIENT_HOST_H_
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_
« no previous file with comments | « content/public/browser/devtools_agent_host_registry.h ('k') | content/public/browser/devtools_frontend_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698