| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/debugger/devtools_agent_host.h" | |
| 6 | |
| 7 #include "base/basictypes.h" | |
| 8 #include "content/common/devtools_messages.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 DevToolsAgentHost::DevToolsAgentHost() : close_listener_(NULL) { | |
| 13 } | |
| 14 | |
| 15 void DevToolsAgentHost::Attach() { | |
| 16 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); | |
| 17 NotifyClientAttaching(); | |
| 18 } | |
| 19 | |
| 20 void DevToolsAgentHost::Reattach(const std::string& saved_agent_state) { | |
| 21 SendMessageToAgent(new DevToolsAgentMsg_Reattach( | |
| 22 MSG_ROUTING_NONE, | |
| 23 saved_agent_state)); | |
| 24 NotifyClientAttaching(); | |
| 25 } | |
| 26 | |
| 27 void DevToolsAgentHost::Detach() { | |
| 28 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); | |
| 29 NotifyClientDetaching(); | |
| 30 } | |
| 31 | |
| 32 void DevToolsAgentHost::DipatchOnInspectorBackend(const std::string& message) { | |
| 33 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( | |
| 34 MSG_ROUTING_NONE, message)); | |
| 35 } | |
| 36 | |
| 37 void DevToolsAgentHost::InspectElement(int x, int y) { | |
| 38 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, | |
| 39 x, y)); | |
| 40 } | |
| 41 | |
| 42 void DevToolsAgentHost::AddMessageToConsole(ConsoleMessageLevel level, | |
| 43 const std::string& message) { | |
| 44 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( | |
| 45 MSG_ROUTING_NONE, | |
| 46 level, | |
| 47 message)); | |
| 48 } | |
| 49 | |
| 50 void DevToolsAgentHost::NotifyCloseListener() { | |
| 51 if (close_listener_) { | |
| 52 close_listener_->AgentHostClosing(this); | |
| 53 close_listener_ = NULL; | |
| 54 } | |
| 55 } | |
| 56 | |
| 57 } // namespace content | |
| OLD | NEW |