OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/shell_devtools_frontend.h" | 5 #include "content/shell/browser/shell_devtools_frontend.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 frontend_shell_(frontend_shell), | 70 frontend_shell_(frontend_shell), |
71 agent_host_(agent_host) { | 71 agent_host_(agent_host) { |
72 } | 72 } |
73 | 73 |
74 ShellDevToolsFrontend::~ShellDevToolsFrontend() { | 74 ShellDevToolsFrontend::~ShellDevToolsFrontend() { |
75 } | 75 } |
76 | 76 |
77 void ShellDevToolsFrontend::RenderViewCreated( | 77 void ShellDevToolsFrontend::RenderViewCreated( |
78 RenderViewHost* render_view_host) { | 78 RenderViewHost* render_view_host) { |
79 if (!frontend_host_) { | 79 if (!frontend_host_) { |
80 frontend_host_.reset(DevToolsFrontendHost::Create(render_view_host, this)); | 80 frontend_host_.reset(DevToolsFrontendHost::Create(web_contents(), this)); |
81 agent_host_->AttachClient(this); | 81 agent_host_->AttachClient(this); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void ShellDevToolsFrontend::WebContentsDestroyed() { | 85 void ShellDevToolsFrontend::WebContentsDestroyed() { |
86 agent_host_->DetachClient(); | 86 agent_host_->DetachClient(); |
87 delete this; | 87 delete this; |
88 } | 88 } |
89 | 89 |
90 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend( | 90 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 base::string16 javascript = base::UTF8ToUTF16(code); | 135 base::string16 javascript = base::UTF8ToUTF16(code); |
136 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); | 136 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); |
137 } | 137 } |
138 | 138 |
139 void ShellDevToolsFrontend::AgentHostClosed( | 139 void ShellDevToolsFrontend::AgentHostClosed( |
140 DevToolsAgentHost* agent_host, bool replaced) { | 140 DevToolsAgentHost* agent_host, bool replaced) { |
141 frontend_shell_->Close(); | 141 frontend_shell_->Close(); |
142 } | 142 } |
143 | 143 |
144 } // namespace content | 144 } // namespace content |
OLD | NEW |