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 #include "content/browser/devtools/devtools_agent_host_impl.h" | 5 #include "content/browser/devtools/devtools_agent_host_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/stringprintf.h" |
8 #include "content/common/devtools_messages.h" | 9 #include "content/common/devtools_messages.h" |
| 10 #include "content/public/browser/devtools_manager.h" |
9 | 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 namespace { | 14 namespace { |
13 static int g_next_agent_host_id = 0; | 15 static int g_next_agent_host_id = 0; |
14 } // namespace | 16 } // namespace |
15 | 17 |
16 DevToolsAgentHostImpl::DevToolsAgentHostImpl() | 18 DevToolsAgentHostImpl::DevToolsAgentHostImpl() |
17 : close_listener_(NULL), | 19 : close_listener_(NULL), |
18 id_(++g_next_agent_host_id) { | 20 id_(base::StringPrintf("%d", ++g_next_agent_host_id)) { |
19 } | 21 } |
20 | 22 |
21 void DevToolsAgentHostImpl::Attach() { | 23 void DevToolsAgentHostImpl::Attach() { |
22 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); | 24 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); |
23 NotifyClientAttaching(); | 25 NotifyClientAttaching(); |
24 } | 26 } |
25 | 27 |
26 void DevToolsAgentHostImpl::Reattach(const std::string& saved_agent_state) { | 28 void DevToolsAgentHostImpl::Reattach(const std::string& saved_agent_state) { |
27 SendMessageToAgent(new DevToolsAgentMsg_Reattach( | 29 SendMessageToAgent(new DevToolsAgentMsg_Reattach( |
28 MSG_ROUTING_NONE, | 30 MSG_ROUTING_NONE, |
(...skipping 22 matching lines...) Expand all Loading... |
51 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( | 53 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( |
52 MSG_ROUTING_NONE, | 54 MSG_ROUTING_NONE, |
53 level, | 55 level, |
54 message)); | 56 message)); |
55 } | 57 } |
56 | 58 |
57 RenderViewHost* DevToolsAgentHostImpl::GetRenderViewHost() { | 59 RenderViewHost* DevToolsAgentHostImpl::GetRenderViewHost() { |
58 return NULL; | 60 return NULL; |
59 } | 61 } |
60 | 62 |
| 63 std::string DevToolsAgentHostImpl::GetTitle() { |
| 64 return ""; |
| 65 } |
| 66 |
| 67 GURL DevToolsAgentHostImpl::GetUrl() { |
| 68 return GURL(); |
| 69 } |
| 70 |
| 71 GURL DevToolsAgentHostImpl::GetFaviconUrl() { |
| 72 return GURL(); |
| 73 } |
| 74 |
61 void DevToolsAgentHostImpl::NotifyCloseListener() { | 75 void DevToolsAgentHostImpl::NotifyCloseListener() { |
62 if (close_listener_) { | 76 if (close_listener_) { |
63 scoped_refptr<DevToolsAgentHostImpl> protect(this); | 77 scoped_refptr<DevToolsAgentHostImpl> protect(this); |
64 close_listener_->AgentHostClosing(this); | 78 close_listener_->AgentHostClosing(this); |
65 close_listener_ = NULL; | 79 close_listener_ = NULL; |
66 } | 80 } |
67 } | 81 } |
68 | 82 |
69 } // namespace content | 83 } // namespace content |
OLD | NEW |