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/renderer/devtools/devtools_agent.h" | 5 #include "content/renderer/devtools/devtools_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 web_frame->addMessageToConsole( | 254 web_frame->addMessageToConsole( |
255 WebConsoleMessage(target_level, WebString::fromUTF8(message))); | 255 WebConsoleMessage(target_level, WebString::fromUTF8(message))); |
256 } | 256 } |
257 | 257 |
258 void DevToolsAgent::ContinueProgram() { | 258 void DevToolsAgent::ContinueProgram() { |
259 WebDevToolsAgent* web_agent = GetWebAgent(); | 259 WebDevToolsAgent* web_agent = GetWebAgent(); |
260 if (web_agent) | 260 if (web_agent) |
261 web_agent->continueProgram(); | 261 web_agent->continueProgram(); |
262 } | 262 } |
263 | 263 |
264 void DevToolsAgent::OnSetupDevToolsClient() { | 264 void DevToolsAgent::OnSetupDevToolsClient(const std::string& injected_script) { |
265 // We only want to register once; and only in main frame. | 265 // We only want to register once; and only in main frame. |
266 DCHECK(!frame_->GetWebFrame() || !frame_->GetWebFrame()->parent()); | 266 DCHECK(!frame_->GetWebFrame() || !frame_->GetWebFrame()->parent()); |
267 if (is_devtools_client_) | 267 if (is_devtools_client_) |
268 return; | 268 return; |
269 is_devtools_client_ = true; | 269 is_devtools_client_ = true; |
270 new DevToolsClient(frame_); | 270 new DevToolsClient(frame_, injected_script); |
271 } | 271 } |
272 | 272 |
273 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { | 273 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { |
274 WebLocalFrame* web_frame = frame_->GetWebFrame(); | 274 WebLocalFrame* web_frame = frame_->GetWebFrame(); |
275 return web_frame ? web_frame->devToolsAgent() : nullptr; | 275 return web_frame ? web_frame->devToolsAgent() : nullptr; |
276 } | 276 } |
277 | 277 |
278 bool DevToolsAgent::IsAttached() { | 278 bool DevToolsAgent::IsAttached() { |
279 return is_attached_; | 279 return is_attached_; |
280 } | 280 } |
281 | 281 |
282 } // namespace content | 282 } // namespace content |
OLD | NEW |