| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debugger/devtools_agent_host.h" | 5 #include "content/browser/debugger/devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "content/common/devtools_messages.h" | 8 #include "content/common/devtools_messages.h" |
| 9 | 9 |
| 10 namespace content { |
| 11 |
| 10 DevToolsAgentHost::DevToolsAgentHost() : close_listener_(NULL) { | 12 DevToolsAgentHost::DevToolsAgentHost() : close_listener_(NULL) { |
| 11 } | 13 } |
| 12 | 14 |
| 13 void DevToolsAgentHost::Attach() { | 15 void DevToolsAgentHost::Attach() { |
| 14 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); | 16 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); |
| 15 } | 17 } |
| 16 | 18 |
| 17 void DevToolsAgentHost::Reattach(const std::string& saved_agent_state) { | 19 void DevToolsAgentHost::Reattach(const std::string& saved_agent_state) { |
| 18 SendMessageToAgent(new DevToolsAgentMsg_Reattach( | 20 SendMessageToAgent(new DevToolsAgentMsg_Reattach( |
| 19 MSG_ROUTING_NONE, | 21 MSG_ROUTING_NONE, |
| 20 saved_agent_state)); | 22 saved_agent_state)); |
| 21 } | 23 } |
| 22 | 24 |
| 23 void DevToolsAgentHost::Detach() { | 25 void DevToolsAgentHost::Detach() { |
| 24 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); | 26 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); |
| 25 } | 27 } |
| 26 | 28 |
| 29 void DevToolsAgentHost::DipatchOnInspectorBackend(const std::string& message) { |
| 30 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( |
| 31 MSG_ROUTING_NONE, message)); |
| 32 } |
| 33 |
| 34 void DevToolsAgentHost::InspectElement(int x, int y) { |
| 35 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, |
| 36 x, y)); |
| 37 } |
| 38 |
| 27 void DevToolsAgentHost::NotifyCloseListener() { | 39 void DevToolsAgentHost::NotifyCloseListener() { |
| 28 if (close_listener_) { | 40 if (close_listener_) { |
| 29 close_listener_->AgentHostClosing(this); | 41 close_listener_->AgentHostClosing(this); |
| 30 close_listener_ = NULL; | 42 close_listener_ = NULL; |
| 31 } | 43 } |
| 32 } | 44 } |
| 33 | 45 |
| 46 } // namespace content |
| OLD | NEW |