| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 base::Bind(&DevToolsAgent::GotManifest, | 271 base::Bind(&DevToolsAgent::GotManifest, |
| 272 weak_factory_.GetWeakPtr(), session_id, call_id)); | 272 weak_factory_.GetWeakPtr(), session_id, call_id)); |
| 273 return; | 273 return; |
| 274 } | 274 } |
| 275 GetWebAgent()->dispatchOnInspectorBackend(session_id, | 275 GetWebAgent()->dispatchOnInspectorBackend(session_id, |
| 276 call_id, | 276 call_id, |
| 277 WebString::fromUTF8(method), | 277 WebString::fromUTF8(method), |
| 278 WebString::fromUTF8(message)); | 278 WebString::fromUTF8(message)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void DevToolsAgent::OnInspectElement(int x, int y) { | 281 void DevToolsAgent::OnInspectElement(int session_id, int x, int y) { |
| 282 blink::WebFloatRect point_rect(x, y, 0, 0); | 282 blink::WebFloatRect point_rect(x, y, 0, 0); |
| 283 frame_->GetRenderWidget()->convertWindowToViewport(&point_rect); | 283 frame_->GetRenderWidget()->convertWindowToViewport(&point_rect); |
| 284 GetWebAgent()->inspectElementAt(WebPoint(point_rect.x, point_rect.y)); | 284 GetWebAgent()->inspectElementAt( |
| 285 session_id, WebPoint(point_rect.x, point_rect.y)); |
| 285 } | 286 } |
| 286 | 287 |
| 287 void DevToolsAgent::OnRequestNewWindowACK(bool success) { | 288 void DevToolsAgent::OnRequestNewWindowACK(bool success) { |
| 288 if (!success) | 289 if (!success) |
| 289 GetWebAgent()->failedToRequestDevTools(); | 290 GetWebAgent()->failedToRequestDevTools(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void DevToolsAgent::ContinueProgram() { | 293 void DevToolsAgent::ContinueProgram() { |
| 293 GetWebAgent()->continueProgram(); | 294 GetWebAgent()->continueProgram(); |
| 294 } | 295 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 result->Set("errors", errors.release()); | 344 result->Set("errors", errors.release()); |
| 344 response->Set("result", result.release()); | 345 response->Set("result", result.release()); |
| 345 | 346 |
| 346 std::string json_message; | 347 std::string json_message; |
| 347 base::JSONWriter::Write(*response, &json_message); | 348 base::JSONWriter::Write(*response, &json_message); |
| 348 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id, | 349 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id, |
| 349 json_message, std::string()); | 350 json_message, std::string()); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace content | 353 } // namespace content |
| OLD | NEW |