| 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 CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 5 #ifndef CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
| 6 #define CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 6 #define CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 DevToolsAgent(int routing_id, RenderView* view); | 33 DevToolsAgent(int routing_id, RenderView* view); |
| 34 virtual ~DevToolsAgent(); | 34 virtual ~DevToolsAgent(); |
| 35 | 35 |
| 36 void OnNavigate(); | 36 void OnNavigate(); |
| 37 | 37 |
| 38 // IPC message interceptor. Called on the Render thread. | 38 // IPC message interceptor. Called on the Render thread. |
| 39 virtual bool OnMessageReceived(const IPC::Message& message); | 39 virtual bool OnMessageReceived(const IPC::Message& message); |
| 40 | 40 |
| 41 // WebDevToolsAgentClient implementation | 41 // WebDevToolsAgentClient implementation |
| 42 virtual void sendMessageToFrontend( | 42 virtual void sendMessageToInspectorFrontend(const WebKit::WebString& data); |
| 43 const WebKit::WebDevToolsMessageData& data); | 43 virtual void sendDebuggerOutput(const WebKit::WebString& data); |
| 44 virtual void sendDispatchToAPU(const WebKit::WebString& data); |
| 44 | 45 |
| 45 virtual int hostIdentifier(); | 46 virtual int hostIdentifier(); |
| 46 virtual void forceRepaint(); | 47 virtual void forceRepaint(); |
| 47 virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, | 48 virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, |
| 48 bool enabled); | 49 bool enabled); |
| 49 virtual WebKit::WebCString injectedScriptSource(); | 50 virtual WebKit::WebCString injectedScriptSource(); |
| 50 virtual WebKit::WebCString injectedScriptDispatcherSource(); | 51 virtual WebKit::WebCString injectedScriptDispatcherSource(); |
| 51 virtual WebKit::WebCString debuggerScriptSource(); | 52 virtual WebKit::WebCString debuggerScriptSource(); |
| 52 virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop* | 53 virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop* |
| 53 createClientMessageLoop(); | 54 createClientMessageLoop(); |
| 54 virtual bool exposeV8DebuggerProtocol(); | 55 virtual bool exposeV8DebuggerProtocol(); |
| 55 | 56 |
| 56 // Returns agent instance for its host id. | 57 // Returns agent instance for its host id. |
| 57 static DevToolsAgent* FromHostId(int host_id); | 58 static DevToolsAgent* FromHostId(int host_id); |
| 58 | 59 |
| 59 RenderView* render_view() { return render_view_; } | 60 RenderView* render_view() { return render_view_; } |
| 60 | 61 |
| 61 WebKit::WebDevToolsAgent* GetWebAgent(); | 62 WebKit::WebDevToolsAgent* GetWebAgent(); |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 friend class DevToolsAgentFilter; | 65 friend class DevToolsAgentFilter; |
| 65 | 66 |
| 66 void OnAttach(const std::vector<std::string>& runtime_features); | 67 void OnAttach(const std::vector<std::string>& runtime_features); |
| 67 void OnDetach(); | 68 void OnDetach(); |
| 68 void OnRpcMessage(const DevToolsMessageData& data); | 69 void OnDispatchOnInspectorBackend(const std::string& message); |
| 69 void OnInspectElement(int x, int y); | 70 void OnInspectElement(int x, int y); |
| 70 void OnSetApuAgentEnabled(bool enabled); | 71 void OnSetApuAgentEnabled(bool enabled); |
| 71 | 72 |
| 72 static std::map<int, DevToolsAgent*> agent_for_routing_id_; | 73 static std::map<int, DevToolsAgent*> agent_for_routing_id_; |
| 73 | 74 |
| 74 int routing_id_; // View routing id that we can access from IO thread. | 75 int routing_id_; // View routing id that we can access from IO thread. |
| 75 RenderView* render_view_; | 76 RenderView* render_view_; |
| 76 bool expose_v8_debugger_protocol_; | 77 bool expose_v8_debugger_protocol_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 79 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 82 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
| OLD | NEW |