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/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 "content/browser/debugger/devtools_manager.h" | 8 #include "content/browser/debugger/devtools_manager.h" |
9 #include "content/browser/debugger/render_view_devtools_agent_host.h" | 9 #include "content/browser/debugger/render_view_devtools_agent_host.h" |
10 #include "content/browser/renderer_host/render_process_host.h" | 10 #include "content/browser/renderer_host/render_process_host.h" |
11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/site_instance.h" | 12 #include "content/browser/site_instance.h" |
13 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
14 #include "content/common/devtools_messages.h" | 14 #include "content/common/devtools_messages.h" |
15 #include "content/common/notification_service.h" | |
16 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
| 16 #include "content/public/browser/notification_service.h" |
17 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
18 | 18 |
19 RenderViewDevToolsAgentHost::Instances RenderViewDevToolsAgentHost::instances_; | 19 RenderViewDevToolsAgentHost::Instances RenderViewDevToolsAgentHost::instances_; |
20 | 20 |
21 DevToolsAgentHost* RenderViewDevToolsAgentHost::FindFor( | 21 DevToolsAgentHost* RenderViewDevToolsAgentHost::FindFor( |
22 RenderViewHost* rvh) { | 22 RenderViewHost* rvh) { |
23 Instances::iterator it = instances_.find(rvh); | 23 Instances::iterator it = instances_.find(rvh); |
24 if (it != instances_.end()) | 24 if (it != instances_.end()) |
25 return it->second; | 25 return it->second; |
26 return new RenderViewDevToolsAgentHost(rvh); | 26 return new RenderViewDevToolsAgentHost(rvh); |
(...skipping 20 matching lines...) Expand all Loading... |
47 render_view_host_(rvh) { | 47 render_view_host_(rvh) { |
48 instances_[rvh] = this; | 48 instances_[rvh] = this; |
49 } | 49 } |
50 | 50 |
51 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { | 51 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { |
52 msg->set_routing_id(render_view_host_->routing_id()); | 52 msg->set_routing_id(render_view_host_->routing_id()); |
53 render_view_host_->Send(msg); | 53 render_view_host_->Send(msg); |
54 } | 54 } |
55 | 55 |
56 void RenderViewDevToolsAgentHost::NotifyClientClosing() { | 56 void RenderViewDevToolsAgentHost::NotifyClientClosing() { |
57 NotificationService::current()->Notify( | 57 content::NotificationService::current()->Notify( |
58 content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, | 58 content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, |
59 content::Source<content::BrowserContext>( | 59 content::Source<content::BrowserContext>( |
60 render_view_host_->site_instance()->GetProcess()->browser_context()), | 60 render_view_host_->site_instance()->GetProcess()->browser_context()), |
61 content::Details<RenderViewHost>(render_view_host_)); | 61 content::Details<RenderViewHost>(render_view_host_)); |
62 } | 62 } |
63 | 63 |
64 int RenderViewDevToolsAgentHost::GetRenderProcessId() { | 64 int RenderViewDevToolsAgentHost::GetRenderProcessId() { |
65 return render_view_host_->process()->id(); | 65 return render_view_host_->process()->id(); |
66 } | 66 } |
67 | 67 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 void RenderViewDevToolsAgentHost::OnClearBrowserCache() { | 103 void RenderViewDevToolsAgentHost::OnClearBrowserCache() { |
104 content::GetContentClient()->browser()->ClearCache(render_view_host_); | 104 content::GetContentClient()->browser()->ClearCache(render_view_host_); |
105 } | 105 } |
106 | 106 |
107 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { | 107 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { |
108 content::GetContentClient()->browser()->ClearCookies(render_view_host_); | 108 content::GetContentClient()->browser()->ClearCookies(render_view_host_); |
109 } | 109 } |
110 | 110 |
OLD | NEW |