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/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 WebDevToolsAgent* web_agent = GetWebAgent(); | 274 WebDevToolsAgent* web_agent = GetWebAgent(); |
| 275 if (web_agent) { | 275 if (web_agent) { |
| 276 web_agent->detach(); | 276 web_agent->detach(); |
| 277 is_attached_ = false; | 277 is_attached_ = false; |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 | 280 |
| 281 void DevToolsAgent::OnDispatchOnInspectorBackend(const std::string& message) { | 281 void DevToolsAgent::OnDispatchOnInspectorBackend(const std::string& message) { |
| 282 TRACE_EVENT0("devtools", "DevToolsAgent::OnDispatchOnInspectorBackend"); | 282 TRACE_EVENT0("devtools", "DevToolsAgent::OnDispatchOnInspectorBackend"); |
| 283 WebDevToolsAgent* web_agent = GetWebAgent(); | 283 WebDevToolsAgent* web_agent = GetWebAgent(); |
| 284 if (web_agent) | 284 if (!web_agent) |
| 285 return; | |
|
yurys
2015/02/16 16:30:27
revert this?
sergeyv
2015/02/16 17:41:52
Done.
| |
| 286 | |
| 287 | |
| 285 web_agent->dispatchOnInspectorBackend(WebString::fromUTF8(message)); | 288 web_agent->dispatchOnInspectorBackend(WebString::fromUTF8(message)); |
| 286 } | 289 } |
| 287 | 290 |
| 288 void DevToolsAgent::OnInspectElement( | 291 void DevToolsAgent::OnInspectElement( |
| 289 const std::string& host_id, int x, int y) { | 292 const std::string& host_id, int x, int y) { |
| 290 WebDevToolsAgent* web_agent = GetWebAgent(); | 293 WebDevToolsAgent* web_agent = GetWebAgent(); |
| 291 if (web_agent) { | 294 if (web_agent) { |
| 292 web_agent->attach(WebString::fromUTF8(host_id)); | 295 web_agent->attach(WebString::fromUTF8(host_id)); |
| 293 web_agent->inspectElementAt(WebPoint(x, y)); | 296 web_agent->inspectElementAt(WebPoint(x, y)); |
| 294 is_attached_ = true; | 297 is_attached_ = true; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 347 | 350 |
| 348 RenderViewImpl* DevToolsAgent::GetRenderViewImpl() { | 351 RenderViewImpl* DevToolsAgent::GetRenderViewImpl() { |
| 349 return static_cast<RenderViewImpl*>(main_render_frame_->GetRenderView()); | 352 return static_cast<RenderViewImpl*>(main_render_frame_->GetRenderView()); |
| 350 } | 353 } |
| 351 | 354 |
| 352 bool DevToolsAgent::IsAttached() { | 355 bool DevToolsAgent::IsAttached() { |
| 353 return is_attached_; | 356 return is_attached_; |
| 354 } | 357 } |
| 355 | 358 |
| 356 } // namespace content | 359 } // namespace content |
| OLD | NEW |