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

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: 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
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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 655
656 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame) 656 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame)
657 { 657 {
658 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR equest::ReadOnly | HitTestRequest::AllowChildFrameContent; 658 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR equest::ReadOnly | HitTestRequest::AllowChildFrameContent;
659 HitTestRequest request(hitType); 659 HitTestRequest request(hitType);
660 WebMouseEvent dummyEvent; 660 WebMouseEvent dummyEvent;
661 dummyEvent.type = WebInputEvent::MouseDown; 661 dummyEvent.type = WebInputEvent::MouseDown;
662 dummyEvent.x = pointInRootFrame.x; 662 dummyEvent.x = pointInRootFrame.x;
663 dummyEvent.y = pointInRootFrame.y; 663 dummyEvent.y = pointInRootFrame.y;
664 IntPoint transformedPoint = PlatformMouseEventBuilder(m_webLocalFrameImpl->f rameView(), dummyEvent).position(); 664 IntPoint transformedPoint = PlatformMouseEventBuilder(m_webLocalFrameImpl->f rameView(), dummyEvent).position();
665 HitTestResult result(m_webLocalFrameImpl->frameView()->rootFrameToContents(t ransformedPoint)); 665 HitTestResult result(request, m_webLocalFrameImpl->frameView()->rootFrameToC ontents(transformedPoint));
666 m_webLocalFrameImpl->frame()->contentRenderer()->hitTest(request, result); 666 m_webLocalFrameImpl->frame()->contentRenderer()->hitTest(result);
667 Node* node = result.innerNode(); 667 Node* node = result.innerNode();
668 if (!node && m_webLocalFrameImpl->frame()->document()) 668 if (!node && m_webLocalFrameImpl->frame()->document())
669 node = m_webLocalFrameImpl->frame()->document()->documentElement(); 669 node = m_webLocalFrameImpl->frame()->document()->documentElement();
670 m_domAgent->inspect(node); 670 m_domAgent->inspect(node);
671 } 671 }
672 672
673 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec t> message) 673 void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObjec t> message)
674 { 674 {
675 if (!m_attached) 675 if (!m_attached)
676 return; 676 return;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) 758 if (!InspectorBackendDispatcher::getCommandName(message, &commandName))
759 return false; 759 return false;
760 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd) 760 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd)
761 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd) 761 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd)
762 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd) 762 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd)
763 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) 763 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd)
764 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); 764 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd);
765 } 765 }
766 766
767 } // namespace blink 767 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698