| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
| 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class CONTENT_EXPORT DevToolsAgent | 26 class CONTENT_EXPORT DevToolsAgent |
| 27 : public RenderFrameObserver, | 27 : public RenderFrameObserver, |
| 28 NON_EXPORTED_BASE(public blink::WebDevToolsAgentClient) { | 28 NON_EXPORTED_BASE(public blink::WebDevToolsAgentClient) { |
| 29 public: | 29 public: |
| 30 explicit DevToolsAgent(RenderFrameImpl* frame); | 30 explicit DevToolsAgent(RenderFrameImpl* frame); |
| 31 ~DevToolsAgent() override; | 31 ~DevToolsAgent() override; |
| 32 | 32 |
| 33 // Returns agent instance for its routing id. | 33 // Returns agent instance for its routing id. |
| 34 static DevToolsAgent* FromRoutingId(int routing_id); | 34 static DevToolsAgent* FromRoutingId(int routing_id); |
| 35 | 35 |
| 36 static void SendChunkedProtocolMessage( | 36 static void SendChunkedProtocolMessage(IPC::Sender* sender, |
| 37 IPC::Sender* sender, | 37 int routing_id, |
| 38 int routing_id, | 38 int session_id, |
| 39 int call_id, | 39 int call_id, |
| 40 const std::string& message, | 40 const std::string& message, |
| 41 const std::string& post_state); | 41 const std::string& post_state); |
| 42 | 42 |
| 43 blink::WebDevToolsAgent* GetWebAgent(); | 43 blink::WebDevToolsAgent* GetWebAgent(); |
| 44 | 44 |
| 45 bool IsAttached(); | 45 bool IsAttached(); |
| 46 | 46 |
| 47 void AddMessageToConsole(ConsoleMessageLevel level, | 47 void AddMessageToConsole(ConsoleMessageLevel level, |
| 48 const std::string& message); | 48 const std::string& message); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend class DevToolsAgentTest; | 51 friend class DevToolsAgentTest; |
| 52 | 52 |
| 53 // RenderFrameObserver implementation. | 53 // RenderFrameObserver implementation. |
| 54 bool OnMessageReceived(const IPC::Message& message) override; | 54 bool OnMessageReceived(const IPC::Message& message) override; |
| 55 void WidgetWillClose() override; | 55 void WidgetWillClose() override; |
| 56 | 56 |
| 57 // WebDevToolsAgentClient implementation. | 57 // WebDevToolsAgentClient implementation. |
| 58 void sendProtocolMessage(int call_id, | 58 void sendProtocolMessage(int session_id, |
| 59 int call_id, |
| 59 const blink::WebString& response, | 60 const blink::WebString& response, |
| 60 const blink::WebString& state) override; | 61 const blink::WebString& state) override; |
| 61 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* | 62 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* |
| 62 createClientMessageLoop() override; | 63 createClientMessageLoop() override; |
| 63 void willEnterDebugLoop() override; | 64 void willEnterDebugLoop() override; |
| 64 void didExitDebugLoop() override; | 65 void didExitDebugLoop() override; |
| 65 | 66 |
| 66 void enableTracing(const blink::WebString& category_filter) override; | 67 void enableTracing(const blink::WebString& category_filter) override; |
| 67 void disableTracing() override; | 68 void disableTracing() override; |
| 68 | 69 |
| 69 void OnAttach(const std::string& host_id); | 70 void OnAttach(const std::string& host_id, int session_id); |
| 70 void OnReattach(const std::string& host_id, | 71 void OnReattach(const std::string& host_id, |
| 72 int session_id, |
| 71 const std::string& agent_state); | 73 const std::string& agent_state); |
| 72 void OnDetach(); | 74 void OnDetach(); |
| 73 void OnDispatchOnInspectorBackend(const std::string& message); | 75 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); |
| 74 void OnInspectElement(int x, int y); | 76 void OnInspectElement(int x, int y); |
| 75 void ContinueProgram(); | 77 void ContinueProgram(); |
| 76 void OnSetupDevToolsClient(const std::string& compatibility_script); | 78 void OnSetupDevToolsClient(const std::string& compatibility_script); |
| 77 | 79 |
| 78 bool is_attached_; | 80 bool is_attached_; |
| 79 bool is_devtools_client_; | 81 bool is_devtools_client_; |
| 80 bool paused_in_mouse_move_; | 82 bool paused_in_mouse_move_; |
| 81 bool paused_; | 83 bool paused_; |
| 82 RenderFrameImpl* frame_; | 84 RenderFrameImpl* frame_; |
| 83 | 85 |
| 84 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 86 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 } // namespace content | 89 } // namespace content |
| 88 | 90 |
| 89 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 91 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
| OLD | NEW |