OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ | 5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ |
6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ | 6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ |
7 | 7 |
8 #include <string> | |
9 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
10 | 9 |
| 10 namespace WebKit { |
| 11 class WebString; |
| 12 } |
| 13 |
11 // WebDevToolsAgent represents DevTools agent sitting in the Glue. It provides | 14 // WebDevToolsAgent represents DevTools agent sitting in the Glue. It provides |
12 // direct and delegate Apis to the host. | 15 // direct and delegate Apis to the host. |
13 class WebDevToolsAgent { | 16 class WebDevToolsAgent { |
14 public: | 17 public: |
15 class Message { | 18 class Message { |
16 public: | 19 public: |
17 Message() {} | 20 Message() {} |
18 virtual ~Message() {} | 21 virtual ~Message() {} |
19 virtual void Dispatch() = 0; | 22 virtual void Dispatch() = 0; |
20 private: | 23 private: |
21 DISALLOW_COPY_AND_ASSIGN(Message); | 24 DISALLOW_COPY_AND_ASSIGN(Message); |
22 }; | 25 }; |
23 | 26 |
24 WebDevToolsAgent() {} | 27 WebDevToolsAgent() {} |
25 virtual ~WebDevToolsAgent() {} | 28 virtual ~WebDevToolsAgent() {} |
26 | 29 |
27 virtual void Attach() = 0; | 30 virtual void Attach() = 0; |
28 | 31 |
29 virtual void Detach() = 0; | 32 virtual void Detach() = 0; |
30 | 33 |
31 virtual void OnNavigate() = 0; | 34 virtual void OnNavigate() = 0; |
32 | 35 |
33 virtual void DispatchMessageFromClient(const std::string& class_name, | 36 virtual void DispatchMessageFromClient(const WebKit::WebString& class_name, |
34 const std::string& method_name, | 37 const WebKit::WebString& method_name, |
35 const std::string& param1, | 38 const WebKit::WebString& param1, |
36 const std::string& param2, | 39 const WebKit::WebString& param2, |
37 const std::string& param3) = 0; | 40 const WebKit::WebString& param3) = 0; |
38 | 41 |
39 virtual void InspectElement(int x, int y) = 0; | 42 virtual void InspectElement(int x, int y) = 0; |
40 | 43 |
41 virtual void SetApuAgentEnabled(bool enabled) = 0; | 44 virtual void SetApuAgentEnabled(bool enabled) = 0; |
42 | 45 |
43 // Asynchronously executes debugger command in the render thread. | 46 // Asynchronously executes debugger command in the render thread. |
44 // |caller_id| will be used for sending response. | 47 // |caller_id| will be used for sending response. |
45 static void ExecuteDebuggerCommand(const std::string& command, | 48 static void ExecuteDebuggerCommand(const WebKit::WebString& command, |
46 int caller_id); | 49 int caller_id); |
47 | 50 |
48 typedef void (*MessageLoopDispatchHandler)(); | 51 typedef void (*MessageLoopDispatchHandler)(); |
49 | 52 |
50 // Installs dispatch handle that is going to be called periodically | 53 // Installs dispatch handle that is going to be called periodically |
51 // while on a breakpoint. | 54 // while on a breakpoint. |
52 static void SetMessageLoopDispatchHandler( | 55 static void SetMessageLoopDispatchHandler( |
53 MessageLoopDispatchHandler handler); | 56 MessageLoopDispatchHandler handler); |
54 | 57 |
55 private: | 58 private: |
56 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgent); | 59 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgent); |
57 }; | 60 }; |
58 | 61 |
59 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ | 62 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_H_ |
OLD | NEW |