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

Unified Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 23085004: DevTools: handle gesture tap event while in inspecting element mode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.h ('k') | Source/core/inspector/InspectorOverlay.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index a4f32e2453b4d6359cdf3adef905cd829d77744e..39976bdf5485d436e02522a607c575de526e17dc 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -70,6 +70,7 @@
#include "core/page/Frame.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
+#include "core/platform/PlatformGestureEvent.h"
#include "core/platform/PlatformMouseEvent.h"
#include "core/platform/PlatformTouchEvent.h"
#include "core/rendering/HitTestResult.h"
@@ -162,6 +163,11 @@ static Node* hoveredNodeForPoint(Frame* frame, const IntPoint& point, bool ignor
return node;
}
+static Node* hoveredNodeForEvent(Frame* frame, const PlatformGestureEvent& event, bool ignorePointerEventsNone)
+{
+ return hoveredNodeForPoint(frame, event.position(), ignorePointerEventsNone);
+}
+
static Node* hoveredNodeForEvent(Frame* frame, const PlatformMouseEvent& event, bool ignorePointerEventsNone)
{
return hoveredNodeForPoint(frame, event.position(), ignorePointerEventsNone);
@@ -1053,6 +1059,19 @@ bool InspectorDOMAgent::handleMousePress()
return false;
}
+bool InspectorDOMAgent::handleGestureEvent(Frame* frame, const PlatformGestureEvent& event)
+{
+ if (m_searchingForNode == NotSearching || event.type() != PlatformEvent::GestureTap)
+ return false;
+ Node* node = hoveredNodeForEvent(frame, event, false);
+ if (node && m_inspectModeHighlightConfig) {
+ m_overlay->highlightNode(node, 0 /* eventTarget */, *m_inspectModeHighlightConfig);
+ inspect(node);
+ return true;
+ }
+ return false;
+}
+
bool InspectorDOMAgent::handleTouchEvent(Frame* frame, const PlatformTouchEvent& event)
{
if (m_searchingForNode == NotSearching)
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.h ('k') | Source/core/inspector/InspectorOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698