OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | |
6 #define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include <wtf/HashMap.h> | |
11 #include <wtf/OwnPtr.h> | |
12 #include <wtf/RefPtr.h> | |
13 | |
14 #include "v8.h" | |
15 #include "webkit/glue/devtools/devtools_rpc.h" | |
16 #include "webkit/glue/webdevtoolsclient.h" | |
17 | |
18 namespace WebCore { | |
19 class Node; | |
20 class Page; | |
21 class String; | |
22 } | |
23 | |
24 class BoundObject; | |
25 class JsDebuggerAgentBoundObj; | |
26 class JsNetAgentBoundObj; | |
27 class JsToolsAgentBoundObj; | |
28 class ToolsAgentNativeDelegateImpl; | |
29 class WebDevToolsClientDelegate; | |
30 class WebViewImpl; | |
31 | |
32 class WebDevToolsClientImpl : public WebDevToolsClient, | |
33 public DevToolsRpc::Delegate { | |
34 public: | |
35 WebDevToolsClientImpl( | |
36 WebViewImpl* web_view_impl, | |
37 WebDevToolsClientDelegate* delegate, | |
38 const String& application_locale); | |
39 virtual ~WebDevToolsClientImpl(); | |
40 | |
41 // DevToolsRpc::Delegate implementation. | |
42 virtual void SendRpcMessage(const String& class_name, | |
43 const String& method_name, | |
44 const String& param1, | |
45 const String& param2, | |
46 const String& param3); | |
47 | |
48 // WebDevToolsClient implementation. | |
49 virtual void DispatchMessageFromAgent(const WebKit::WebString& class_name, | |
50 const WebKit::WebString& method_name, | |
51 const WebKit::WebString& param1, | |
52 const WebKit::WebString& param2, | |
53 const WebKit::WebString& param3); | |
54 | |
55 private: | |
56 void AddResourceSourceToFrame(int resource_id, | |
57 String mime_type, | |
58 WebCore::Node* frame); | |
59 | |
60 void ExecuteScript(const Vector<String>& v); | |
61 static v8::Handle<v8::Value> JsReset(const v8::Arguments& args); | |
62 static v8::Handle<v8::Value> JsAddSourceToFrame(const v8::Arguments& args); | |
63 static v8::Handle<v8::Value> JsAddResourceSourceToFrame( | |
64 const v8::Arguments& args); | |
65 static v8::Handle<v8::Value> JsLoaded(const v8::Arguments& args); | |
66 static v8::Handle<v8::Value> JsGetPlatform(const v8::Arguments& args); | |
67 | |
68 static v8::Handle<v8::Value> JsActivateWindow(const v8::Arguments& args); | |
69 static v8::Handle<v8::Value> JsCloseWindow(const v8::Arguments& args); | |
70 static v8::Handle<v8::Value> JsDockWindow(const v8::Arguments& args); | |
71 static v8::Handle<v8::Value> JsUndockWindow(const v8::Arguments& args); | |
72 static v8::Handle<v8::Value> JsToggleInspectElementMode( | |
73 const v8::Arguments& args); | |
74 static v8::Handle<v8::Value> JsGetApplicationLocale( | |
75 const v8::Arguments& args); | |
76 static v8::Handle<v8::Value> JsHiddenPanels( | |
77 const v8::Arguments& args); | |
78 static v8::Handle<v8::Value> JsDebuggerCommand( | |
79 const v8::Arguments& args); | |
80 | |
81 WebViewImpl* web_view_impl_; | |
82 WebDevToolsClientDelegate* delegate_; | |
83 String application_locale_; | |
84 OwnPtr<BoundObject> debugger_command_executor_obj_; | |
85 OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_; | |
86 OwnPtr<JsToolsAgentBoundObj> tools_agent_obj_; | |
87 bool loaded_; | |
88 Vector<Vector<String> > pending_incoming_messages_; | |
89 OwnPtr<BoundObject> dev_tools_host_; | |
90 OwnPtr<ToolsAgentNativeDelegateImpl> tools_agent_native_delegate_impl_; | |
91 DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl); | |
92 }; | |
93 | |
94 #endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | |
OLD | NEW |