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(IPC::Sender* sender, | 36 static void SendChunkedProtocolMessage( |
37 int routing_id, | 37 IPC::Sender* sender, |
38 int session_id, | 38 int routing_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 session_id, | 58 void sendProtocolMessage(int call_id, |
59 int call_id, | |
60 const blink::WebString& response, | 59 const blink::WebString& response, |
61 const blink::WebString& state) override; | 60 const blink::WebString& state) override; |
62 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* | 61 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* |
63 createClientMessageLoop() override; | 62 createClientMessageLoop() override; |
64 void willEnterDebugLoop() override; | 63 void willEnterDebugLoop() override; |
65 void didExitDebugLoop() override; | 64 void didExitDebugLoop() override; |
66 | 65 |
67 void enableTracing(const blink::WebString& category_filter) override; | 66 void enableTracing(const blink::WebString& category_filter) override; |
68 void disableTracing() override; | 67 void disableTracing() override; |
69 | 68 |
70 void OnAttach(const std::string& host_id, int session_id); | 69 void OnAttach(const std::string& host_id); |
71 void OnReattach(const std::string& host_id, | 70 void OnReattach(const std::string& host_id, |
72 int session_id, | |
73 const std::string& agent_state); | 71 const std::string& agent_state); |
74 void OnDetach(); | 72 void OnDetach(); |
75 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); | 73 void OnDispatchOnInspectorBackend(const std::string& message); |
76 void OnInspectElement(const std::string& host_id, | 74 void OnInspectElement(const std::string& host_id, int x, int y); |
77 int session_id, | |
78 int x, | |
79 int y); | |
80 void ContinueProgram(); | 75 void ContinueProgram(); |
81 void OnSetupDevToolsClient(const std::string& compatibility_script); | 76 void OnSetupDevToolsClient(const std::string& compatibility_script); |
82 | 77 |
83 bool is_attached_; | 78 bool is_attached_; |
84 bool is_devtools_client_; | 79 bool is_devtools_client_; |
85 bool paused_in_mouse_move_; | 80 bool paused_in_mouse_move_; |
86 bool paused_; | 81 bool paused_; |
87 RenderFrameImpl* frame_; | 82 RenderFrameImpl* frame_; |
88 | 83 |
89 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 84 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
90 }; | 85 }; |
91 | 86 |
92 } // namespace content | 87 } // namespace content |
93 | 88 |
94 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 89 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
OLD | NEW |