Chromium Code Reviews| 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; |
| 16 | |
| 17 static std::string GenerateId() { | |
|
pfeldman
2013/03/04 11:43:01
Why?
Vladislav Kaznacheev
2013/03/04 14:30:03
Inlined back.
On 2013/03/04 11:43:01, pfeldman wro
| |
| 18 return base::StringPrintf("%d", ++g_next_agent_host_id); | |
| 19 } | |
| 20 | |
| 14 } // namespace | 21 } // namespace |
| 15 | 22 |
| 16 DevToolsAgentHostImpl::DevToolsAgentHostImpl() | 23 DevToolsAgentHostImpl::DevToolsAgentHostImpl() |
| 17 : close_listener_(NULL), | 24 : close_listener_(NULL), |
| 18 id_(++g_next_agent_host_id) { | 25 id_(GenerateId()) { |
| 19 } | 26 } |
| 20 | 27 |
| 21 void DevToolsAgentHostImpl::Attach() { | 28 void DevToolsAgentHostImpl::Attach() { |
| 22 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); | 29 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); |
| 23 NotifyClientAttaching(); | 30 NotifyClientAttaching(); |
| 24 } | 31 } |
| 25 | 32 |
| 26 void DevToolsAgentHostImpl::Reattach(const std::string& saved_agent_state) { | 33 void DevToolsAgentHostImpl::Reattach(const std::string& saved_agent_state) { |
| 27 SendMessageToAgent(new DevToolsAgentMsg_Reattach( | 34 SendMessageToAgent(new DevToolsAgentMsg_Reattach( |
| 28 MSG_ROUTING_NONE, | 35 MSG_ROUTING_NONE, |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 51 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( | 58 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( |
| 52 MSG_ROUTING_NONE, | 59 MSG_ROUTING_NONE, |
| 53 level, | 60 level, |
| 54 message)); | 61 message)); |
| 55 } | 62 } |
| 56 | 63 |
| 57 RenderViewHost* DevToolsAgentHostImpl::GetRenderViewHost() { | 64 RenderViewHost* DevToolsAgentHostImpl::GetRenderViewHost() { |
| 58 return NULL; | 65 return NULL; |
| 59 } | 66 } |
| 60 | 67 |
| 68 std::string DevToolsAgentHostImpl::title() { | |
| 69 return ""; | |
| 70 } | |
| 71 | |
| 72 GURL DevToolsAgentHostImpl::url() { | |
| 73 return GURL(); | |
| 74 } | |
| 75 | |
| 76 GURL DevToolsAgentHostImpl::thumbnail_url() { | |
| 77 return GURL(); | |
| 78 } | |
| 79 | |
| 80 GURL DevToolsAgentHostImpl::favicon_url() { | |
| 81 return GURL(); | |
| 82 } | |
| 83 | |
| 61 void DevToolsAgentHostImpl::NotifyCloseListener() { | 84 void DevToolsAgentHostImpl::NotifyCloseListener() { |
| 62 if (close_listener_) { | 85 if (close_listener_) { |
| 63 scoped_refptr<DevToolsAgentHostImpl> protect(this); | 86 scoped_refptr<DevToolsAgentHostImpl> protect(this); |
| 64 close_listener_->AgentHostClosing(this); | 87 close_listener_->AgentHostClosing(this); |
| 65 close_listener_ = NULL; | 88 close_listener_ = NULL; |
| 66 } | 89 } |
| 67 } | 90 } |
| 68 | 91 |
| 69 } // namespace content | 92 } // namespace content |
| OLD | NEW |