OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "content/common/content_export.h" | |
11 | |
12 namespace content { | |
13 | |
14 class RenderViewHost; | |
15 | |
16 // This class dispatches messages between DevTools frontend and Delegate | |
17 // which is implemented by the embedder. | |
18 // This allows us to avoid exposing DevTools frontend messages through | |
19 // the content public API. | |
20 class DevToolsFrontendHost { | |
21 public: | |
22 // Delegate actually handles messages from frontend. | |
23 class Delegate { | |
24 public: | |
25 virtual ~Delegate() {} | |
26 | |
27 // Message is coming from frontend to the embedder. | |
28 virtual void HandleMessageFromDevToolsFrontend( | |
29 const std::string& message) = 0; | |
30 | |
31 // Message is coming from frontend to the backend. | |
32 // TODO(dgozman): remove this by making one of the possible messages | |
33 // passed via the method above. | |
34 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!
| |
35 const std::string& message) = 0; | |
36 }; | |
37 | |
38 // Creates a new DevToolsFrontendHost for RenderViewHost where DevTools | |
39 // frontend is loaded. | |
40 CONTENT_EXPORT static DevToolsFrontendHost* Create( | |
41 RenderViewHost* frontend_rvh, Delegate* delegate); | |
42 | |
43 CONTENT_EXPORT virtual ~DevToolsFrontendHost() {} | |
44 | |
45 // Dispatches message from embedder/backend to frontend. | |
46 // TODO(dgozman): remove and make embedder to take care of this. | |
47 CONTENT_EXPORT virtual void DispatchOnDevToolsFrontend( | |
48 const std::string& message) = 0; | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ | |
OLD | NEW |