OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 else | 602 else |
603 dispatchMessageFromFrontend(message); | 603 dispatchMessageFromFrontend(message); |
604 } | 604 } |
605 | 605 |
606 void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const String& message) | 606 void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const String& message) |
607 { | 607 { |
608 if (m_inspectorBackendDispatcher) | 608 if (m_inspectorBackendDispatcher) |
609 m_inspectorBackendDispatcher->dispatch(message); | 609 m_inspectorBackendDispatcher->dispatch(message); |
610 } | 610 } |
611 | 611 |
612 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) | 612 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame) |
613 { | 613 { |
614 Page* page = m_webViewImpl->page(); | 614 Page* page = m_webViewImpl->page(); |
615 if (!page) | 615 if (!page) |
616 return; | 616 return; |
617 | 617 |
618 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; | 618 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; |
619 HitTestRequest request(hitType); | 619 HitTestRequest request(hitType); |
620 WebMouseEvent dummyEvent; | 620 WebMouseEvent dummyEvent; |
621 dummyEvent.type = WebInputEvent::MouseDown; | 621 dummyEvent.type = WebInputEvent::MouseDown; |
622 dummyEvent.x = point.x; | 622 dummyEvent.x = pointInRootFrame.x; |
623 dummyEvent.y = point.y; | 623 dummyEvent.y = pointInRootFrame.y; |
624 IntPoint transformedPoint = PlatformMouseEventBuilder(page->deprecatedLocalM
ainFrame()->view(), dummyEvent).position(); | 624 IntPoint transformedPoint = PlatformMouseEventBuilder(page->deprecatedLocalM
ainFrame()->view(), dummyEvent).position(); |
625 HitTestResult result(page->deprecatedLocalMainFrame()->view()->windowToConte
nts(transformedPoint)); | 625 HitTestResult result(page->deprecatedLocalMainFrame()->view()->rootFrameToCo
ntents(transformedPoint)); |
626 page->deprecatedLocalMainFrame()->contentRenderer()->hitTest(request, result
); | 626 page->deprecatedLocalMainFrame()->contentRenderer()->hitTest(request, result
); |
627 Node* node = result.innerNode(); | 627 Node* node = result.innerNode(); |
628 if (!node && page->deprecatedLocalMainFrame()->document()) | 628 if (!node && page->deprecatedLocalMainFrame()->document()) |
629 node = page->deprecatedLocalMainFrame()->document()->documentElement(); | 629 node = page->deprecatedLocalMainFrame()->document()->documentElement(); |
630 m_domAgent->inspect(node); | 630 m_domAgent->inspect(node); |
631 } | 631 } |
632 | 632 |
633 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec
t> message) | 633 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec
t> message) |
634 { | 634 { |
635 if (!m_attached) | 635 if (!m_attached) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) | 718 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) |
719 return false; | 719 return false; |
720 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) | 720 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) |
721 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) | 721 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) |
722 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) | 722 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) |
723 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 723 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
724 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 724 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
725 } | 725 } |
726 | 726 |
727 } // namespace blink | 727 } // namespace blink |
OLD | NEW |