Index: content/public/browser/devtools_frontend_host.h |
diff --git a/content/public/browser/devtools_frontend_host.h b/content/public/browser/devtools_frontend_host.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d9fd03a7dcb1f8386e01fd0a5a3c95ba5f9f63d |
--- /dev/null |
+++ b/content/public/browser/devtools_frontend_host.h |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ |
+#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ |
+ |
+#include <string> |
+ |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+ |
+class RenderViewHost; |
+ |
+// This class dispatches messages between DevTools frontend and Delegate |
+// which is implemented by the embedder. |
+// This allows us to avoid exposing DevTools frontend messages through |
+// the content public API. |
+class DevToolsFrontendHost { |
+ public: |
+ // Delegate actually handles messages from frontend. |
+ class Delegate { |
+ public: |
+ virtual ~Delegate() {} |
+ |
+ // Message is coming from frontend to the embedder. |
+ virtual void HandleMessageFromDevToolsFrontend( |
+ const std::string& message) = 0; |
+ |
+ // Message is coming from frontend to the backend. |
+ // TODO(dgozman): remove this by making one of the possible messages |
+ // passed via the method above. |
+ virtual void HandleMessageFromDevToolsFrontendToBackend( |
jam
2014/07/31 22:05:47
nit: once this is removed, please change the singl
dgozman
2014/08/01 10:01:25
Sure!
|
+ const std::string& message) = 0; |
+ }; |
+ |
+ // Creates a new DevToolsFrontendHost for RenderViewHost where DevTools |
+ // frontend is loaded. |
+ CONTENT_EXPORT static DevToolsFrontendHost* Create( |
+ RenderViewHost* frontend_rvh, Delegate* delegate); |
+ |
+ CONTENT_EXPORT virtual ~DevToolsFrontendHost() {} |
+ |
+ // Dispatches message from embedder/backend to frontend. |
+ // TODO(dgozman): remove and make embedder to take care of this. |
+ CONTENT_EXPORT virtual void DispatchOnDevToolsFrontend( |
+ const std::string& message) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ |