Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: Source/web/WebDevToolsAgentImpl.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 651
652 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame) 652 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame)
653 { 653 {
654 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR equest::ReadOnly | HitTestRequest::AllowChildFrameContent; 654 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR equest::ReadOnly | HitTestRequest::AllowChildFrameContent;
655 HitTestRequest request(hitType); 655 HitTestRequest request(hitType);
656 WebMouseEvent dummyEvent; 656 WebMouseEvent dummyEvent;
657 dummyEvent.type = WebInputEvent::MouseDown; 657 dummyEvent.type = WebInputEvent::MouseDown;
658 dummyEvent.x = pointInRootFrame.x; 658 dummyEvent.x = pointInRootFrame.x;
659 dummyEvent.y = pointInRootFrame.y; 659 dummyEvent.y = pointInRootFrame.y;
660 IntPoint transformedPoint = PlatformMouseEventBuilder(m_webLocalFrameImpl->f rameView(), dummyEvent).position(); 660 IntPoint transformedPoint = PlatformMouseEventBuilder(m_webLocalFrameImpl->f rameView(), dummyEvent).position();
661 HitTestResult result(m_webLocalFrameImpl->frameView()->rootFrameToContents(t ransformedPoint)); 661 HitTestResult result(request, m_webLocalFrameImpl->frameView()->rootFrameToC ontents(transformedPoint));
662 m_webLocalFrameImpl->frame()->contentRenderer()->hitTest(request, result); 662 m_webLocalFrameImpl->frame()->contentRenderer()->hitTest(result);
663 Node* node = result.innerNode(); 663 Node* node = result.innerNode();
664 if (!node && m_webLocalFrameImpl->frame()->document()) 664 if (!node && m_webLocalFrameImpl->frame()->document())
665 node = m_webLocalFrameImpl->frame()->document()->documentElement(); 665 node = m_webLocalFrameImpl->frame()->document()->documentElement();
666 m_domAgent->inspect(node); 666 m_domAgent->inspect(node);
667 } 667 }
668 668
669 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec t> message) 669 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec t> message)
670 { 670 {
671 if (!m_attached) 671 if (!m_attached)
672 return; 672 return;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) 753 if (!InspectorBackendDispatcher::getCommandName(message, &commandName))
754 return false; 754 return false;
755 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd) 755 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd)
756 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd) 756 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd)
757 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd) 757 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd)
758 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) 758 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd)
759 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); 759 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd);
760 } 760 }
761 761
762 } // namespace blink 762 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698