| 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_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include <wtf/OwnPtr.h> | 10 #include <wtf/OwnPtr.h> |
| 11 | 11 |
| 12 #include "v8.h" | 12 #include "v8.h" |
| 13 #include "webkit/api/public/WebDevToolsAgent.h" |
| 13 #include "webkit/glue/devtools/devtools_rpc.h" | 14 #include "webkit/glue/devtools/devtools_rpc.h" |
| 14 #include "webkit/glue/devtools/apu_agent_delegate.h" | 15 #include "webkit/glue/devtools/apu_agent_delegate.h" |
| 15 #include "webkit/glue/devtools/tools_agent.h" | 16 #include "webkit/glue/devtools/tools_agent.h" |
| 16 #include "webkit/glue/webdevtoolsagent.h" | |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace WebCore { |
| 19 class Document; | 19 class Document; |
| 20 class Node; | 20 class Node; |
| 21 class ScriptState; | 21 class ScriptState; |
| 22 class String; | 22 class String; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace WebKit { | 25 namespace WebKit { |
| 26 class WebDevToolsAgentClient; |
| 26 class WebFrame; | 27 class WebFrame; |
| 27 } | 28 } |
| 28 | 29 |
| 29 class BoundObject; | 30 class BoundObject; |
| 30 class DebuggerAgentDelegateStub; | 31 class DebuggerAgentDelegateStub; |
| 31 class DebuggerAgentImpl; | 32 class DebuggerAgentImpl; |
| 32 class Value; | 33 class Value; |
| 33 class WebDevToolsAgentDelegate; | |
| 34 class WebFrameImpl; | 34 class WebFrameImpl; |
| 35 class WebViewImpl; | 35 class WebViewImpl; |
| 36 | 36 |
| 37 class WebDevToolsAgentImpl | 37 class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgent, |
| 38 : public WebDevToolsAgent, | 38 public ToolsAgent, |
| 39 public ToolsAgent, | 39 public DevToolsRpc::Delegate { |
| 40 public DevToolsRpc::Delegate { | |
| 41 public: | 40 public: |
| 42 WebDevToolsAgentImpl(WebViewImpl* web_view_impl, | 41 WebDevToolsAgentImpl(WebViewImpl* web_view_impl, |
| 43 WebDevToolsAgentDelegate* delegate); | 42 WebKit::WebDevToolsAgentClient* client); |
| 44 virtual ~WebDevToolsAgentImpl(); | 43 virtual ~WebDevToolsAgentImpl(); |
| 45 | 44 |
| 46 // ToolsAgent implementation. | 45 // ToolsAgent implementation. |
| 47 virtual void DispatchOnInspectorController( | 46 virtual void DispatchOnInspectorController( |
| 48 int call_id, | 47 int call_id, |
| 49 const WebCore::String& function_name, | 48 const WebCore::String& function_name, |
| 50 const WebCore::String& json_args); | 49 const WebCore::String& json_args); |
| 51 virtual void DispatchOnInjectedScript( | 50 virtual void DispatchOnInjectedScript( |
| 52 int call_id, | 51 int call_id, |
| 53 const WebCore::String& function_name, | 52 const WebCore::String& function_name, |
| 54 const WebCore::String& json_args); | 53 const WebCore::String& json_args); |
| 55 virtual void ExecuteVoidJavaScript(); | 54 virtual void ExecuteVoidJavaScript(); |
| 56 virtual void GetResourceContent( | 55 virtual void GetResourceContent( |
| 57 int call_id, | 56 int call_id, |
| 58 int identifier); | 57 int identifier); |
| 59 virtual void SetApuAgentEnabled(bool enable); | |
| 60 | 58 |
| 61 // WebDevToolsAgent implementation. | 59 // WebDevToolsAgent implementation. |
| 62 virtual void Attach(); | 60 virtual void attach(); |
| 63 virtual void Detach(); | 61 virtual void detach(); |
| 64 virtual void OnNavigate(); | 62 virtual void didNavigate(); |
| 65 virtual void DispatchMessageFromClient(const WebKit::WebString& class_name, | 63 virtual void dispatchMessageFromFrontend( |
| 66 const WebKit::WebString& method_name, | 64 const WebKit::WebString& class_name, |
| 67 const WebKit::WebString& param1, | 65 const WebKit::WebString& method_name, |
| 68 const WebKit::WebString& param2, | 66 const WebKit::WebString& param1, |
| 69 const WebKit::WebString& param3); | 67 const WebKit::WebString& param2, |
| 70 virtual void InspectElement(int x, int y); | 68 const WebKit::WebString& param3); |
| 69 virtual void inspectElementAt(const WebKit::WebPoint& point); |
| 70 virtual void setApuAgentEnabled(bool enable); |
| 71 | 71 |
| 72 // DevToolsRpc::Delegate implementation. | 72 // DevToolsRpc::Delegate implementation. |
| 73 void SendRpcMessage(const WebCore::String& class_name, | 73 void SendRpcMessage(const WebCore::String& class_name, |
| 74 const WebCore::String& method_name, | 74 const WebCore::String& method_name, |
| 75 const WebCore::String& param1, | 75 const WebCore::String& param1, |
| 76 const WebCore::String& param2, | 76 const WebCore::String& param2, |
| 77 const WebCore::String& param3); | 77 const WebCore::String& param3); |
| 78 | 78 |
| 79 // Methods called by the glue. | 79 // Methods called by the glue. |
| 80 void SetMainFrameDocumentReady(bool ready); | 80 void SetMainFrameDocumentReady(bool ready); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 97 void InitDevToolsAgentHost(); | 97 void InitDevToolsAgentHost(); |
| 98 void ResetInspectorFrontendProxy(); | 98 void ResetInspectorFrontendProxy(); |
| 99 | 99 |
| 100 // Creates InspectorBackend v8 wrapper in the utility context so that it's | 100 // Creates InspectorBackend v8 wrapper in the utility context so that it's |
| 101 // methods prototype is Function.protoype object from the utility context. | 101 // methods prototype is Function.protoype object from the utility context. |
| 102 // Otherwise some useful methods defined on Function.prototype(such as bind) | 102 // Otherwise some useful methods defined on Function.prototype(such as bind) |
| 103 // are missing for InspectorController native methods. | 103 // are missing for InspectorController native methods. |
| 104 v8::Local<v8::Object> CreateInspectorBackendV8Wrapper(); | 104 v8::Local<v8::Object> CreateInspectorBackendV8Wrapper(); |
| 105 | 105 |
| 106 int host_id_; | 106 int host_id_; |
| 107 WebDevToolsAgentDelegate* delegate_; | 107 WebKit::WebDevToolsAgentClient* client_; |
| 108 WebViewImpl* web_view_impl_; | 108 WebViewImpl* web_view_impl_; |
| 109 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; | 109 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; |
| 110 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; | 110 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; |
| 111 OwnPtr<ToolsAgentNativeDelegateStub> tools_agent_native_delegate_stub_; | 111 OwnPtr<ToolsAgentNativeDelegateStub> tools_agent_native_delegate_stub_; |
| 112 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; | 112 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; |
| 113 OwnPtr<ApuAgentDelegateStub> apu_agent_delegate_stub_; | 113 OwnPtr<ApuAgentDelegateStub> apu_agent_delegate_stub_; |
| 114 bool apu_agent_enabled_; | 114 bool apu_agent_enabled_; |
| 115 bool resource_tracking_was_enabled_; | 115 bool resource_tracking_was_enabled_; |
| 116 bool attached_; | 116 bool attached_; |
| 117 // TODO(pfeldman): This should not be needed once GC styles issue is fixed | 117 // TODO(pfeldman): This should not be needed once GC styles issue is fixed |
| 118 // for matching rules. | 118 // for matching rules. |
| 119 v8::Persistent<v8::Context> utility_context_; | 119 v8::Persistent<v8::Context> utility_context_; |
| 120 OwnPtr<BoundObject> devtools_agent_host_; | 120 OwnPtr<BoundObject> devtools_agent_host_; |
| 121 OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_; | 121 OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_; |
| 122 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl); | 122 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ | 125 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| OLD | NEW |