| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // There is a corresponding DevToolsClient object on the client side. | 23 // There is a corresponding DevToolsClient object on the client side. |
| 24 class DevToolsAgent : public WebDevToolsAgentDelegate { | 24 class DevToolsAgent : public WebDevToolsAgentDelegate { |
| 25 public: | 25 public: |
| 26 DevToolsAgent(int routing_id, RenderView* view); | 26 DevToolsAgent(int routing_id, RenderView* view); |
| 27 virtual ~DevToolsAgent(); | 27 virtual ~DevToolsAgent(); |
| 28 | 28 |
| 29 // IPC message interceptor. Called on the Render thread. | 29 // IPC message interceptor. Called on the Render thread. |
| 30 virtual bool OnMessageReceived(const IPC::Message& message); | 30 virtual bool OnMessageReceived(const IPC::Message& message); |
| 31 | 31 |
| 32 // WebDevToolsAgentDelegate implementation | 32 // WebDevToolsAgentDelegate implementation |
| 33 virtual void SendMessageToClient(const std::string& raw_msg); | 33 virtual void SendMessageToClient(const std::string& class_name, |
| 34 const std::string& method_name, |
| 35 const std::string& raw_msg); |
| 34 virtual int GetHostId(); | 36 virtual int GetHostId(); |
| 35 virtual void ForceRepaint(); | 37 virtual void ForceRepaint(); |
| 36 | 38 |
| 37 // Returns agent instance for its host id. | 39 // Returns agent instance for its host id. |
| 38 static DevToolsAgent* FromHostId(int host_id); | 40 static DevToolsAgent* FromHostId(int host_id); |
| 39 | 41 |
| 40 RenderView* render_view() { return view_; } | 42 RenderView* render_view() { return view_; } |
| 41 | 43 |
| 42 WebDevToolsAgent* GetWebAgent(); | 44 WebDevToolsAgent* GetWebAgent(); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 friend class DevToolsAgentFilter; | 47 friend class DevToolsAgentFilter; |
| 46 | 48 |
| 47 void OnAttach(); | 49 void OnAttach(); |
| 48 void OnDetach(); | 50 void OnDetach(); |
| 49 void OnRpcMessage(const std::string& raw_msg); | 51 void OnRpcMessage(const std::string& class_name, |
| 52 const std::string& method_name, |
| 53 const std::string& raw_msg); |
| 50 void OnInspectElement(int x, int y); | 54 void OnInspectElement(int x, int y); |
| 51 | 55 |
| 52 static std::map<int, DevToolsAgent*> agent_for_routing_id_; | 56 static std::map<int, DevToolsAgent*> agent_for_routing_id_; |
| 53 | 57 |
| 54 int routing_id_; // View routing id that we can access from IO thread. | 58 int routing_id_; // View routing id that we can access from IO thread. |
| 55 RenderView* view_; | 59 RenderView* view_; |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 61 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 64 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
| OLD | NEW |