OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/browser/devtools/ipc_devtools_agent_host.h" | 5 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 void IPCDevToolsAgentHost::Attach() { | 9 void IPCDevToolsAgentHost::Attach() { |
10 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE, GetId())); | 10 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE, GetId())); |
11 OnClientAttached(); | 11 OnClientAttached(); |
12 } | 12 } |
13 | 13 |
14 void IPCDevToolsAgentHost::Detach() { | 14 void IPCDevToolsAgentHost::Detach() { |
15 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); | 15 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); |
16 OnClientDetached(); | 16 OnClientDetached(); |
17 } | 17 } |
18 | 18 |
19 void IPCDevToolsAgentHost::DispatchProtocolMessage( | 19 bool IPCDevToolsAgentHost::DispatchProtocolMessage( |
20 const std::string& message) { | 20 const std::string& message) { |
| 21 if (DevToolsAgentHostImpl::DispatchProtocolMessage(message)) |
| 22 return true; |
| 23 |
21 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( | 24 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( |
22 MSG_ROUTING_NONE, message)); | 25 MSG_ROUTING_NONE, message)); |
| 26 return true; |
23 } | 27 } |
24 | 28 |
25 void IPCDevToolsAgentHost::InspectElement(int x, int y) { | 29 void IPCDevToolsAgentHost::InspectElement(int x, int y) { |
26 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, | 30 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, |
27 GetId(), x, y)); | 31 GetId(), x, y)); |
28 } | 32 } |
29 | 33 |
30 IPCDevToolsAgentHost::IPCDevToolsAgentHost() | 34 IPCDevToolsAgentHost::IPCDevToolsAgentHost() |
31 : message_buffer_size_(0) { | 35 : message_buffer_size_(0) { |
32 } | 36 } |
(...skipping 30 matching lines...) Expand all Loading... |
63 | 67 |
64 if (chunk.is_last) { | 68 if (chunk.is_last) { |
65 CHECK(message_buffer_.size() == message_buffer_size_); | 69 CHECK(message_buffer_.size() == message_buffer_size_); |
66 SendMessageToClient(message_buffer_); | 70 SendMessageToClient(message_buffer_); |
67 message_buffer_ = std::string(); | 71 message_buffer_ = std::string(); |
68 message_buffer_size_ = 0; | 72 message_buffer_size_ = 0; |
69 } | 73 } |
70 } | 74 } |
71 | 75 |
72 } // namespace content | 76 } // namespace content |
OLD | NEW |