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/debugger/render_view_devtools_agent_host.h" | 5 #include "content/browser/debugger/render_view_devtools_agent_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "content/browser/debugger/devtools_manager_impl.h" | 9 #include "content/browser/debugger/devtools_manager_impl.h" |
10 #include "content/browser/debugger/render_view_devtools_agent_host.h" | 10 #include "content/browser/debugger/render_view_devtools_agent_host.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 Instances::iterator it = g_instances.Get().find(rvh); | 53 Instances::iterator it = g_instances.Get().find(rvh); |
54 return it != g_instances.Get().end(); | 54 return it != g_instances.Get().end(); |
55 } | 55 } |
56 | 56 |
57 bool DevToolsAgentHostRegistry::IsDebuggerAttached(WebContents* web_contents) { | 57 bool DevToolsAgentHostRegistry::IsDebuggerAttached(WebContents* web_contents) { |
58 if (g_instances == NULL) | 58 if (g_instances == NULL) |
59 return false; | 59 return false; |
60 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); | 60 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); |
61 if (!devtools_manager) | 61 if (!devtools_manager) |
62 return false; | 62 return false; |
63 RenderViewHostDelegate* delegate = static_cast<TabContents*>(web_contents); | 63 RenderViewHostDelegate* delegate = |
| 64 static_cast<WebContentsImpl*>(web_contents); |
64 for (Instances::iterator it = g_instances.Get().begin(); | 65 for (Instances::iterator it = g_instances.Get().begin(); |
65 it != g_instances.Get().end(); ++it) { | 66 it != g_instances.Get().end(); ++it) { |
66 if (it->first->GetDelegate() != delegate) | 67 if (it->first->GetDelegate() != delegate) |
67 continue; | 68 continue; |
68 if (devtools_manager->GetDevToolsClientHostFor(it->second)) | 69 if (devtools_manager->GetDevToolsClientHostFor(it->second)) |
69 return true; | 70 return true; |
70 } | 71 } |
71 return false; | 72 return false; |
72 } | 73 } |
73 | 74 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 145 |
145 void RenderViewDevToolsAgentHost::OnClearBrowserCache() { | 146 void RenderViewDevToolsAgentHost::OnClearBrowserCache() { |
146 content::GetContentClient()->browser()->ClearCache(render_view_host_); | 147 content::GetContentClient()->browser()->ClearCache(render_view_host_); |
147 } | 148 } |
148 | 149 |
149 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { | 150 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { |
150 content::GetContentClient()->browser()->ClearCookies(render_view_host_); | 151 content::GetContentClient()->browser()->ClearCookies(render_view_host_); |
151 } | 152 } |
152 | 153 |
153 } // namespace content | 154 } // namespace content |
OLD | NEW |