Commit 25b45e77 authored by Alex Rudenko's avatar Alex Rudenko Committed by Commit Bot

[DevTools] Switch from NodeHighlightTool to the default when mouse moves

The inspect mode does not work if there is a highlighted frame. With
this change, the inspect tool gets reset from the frame highlighting
to the default tool once the mouse moves. The new behavior affects
NodeHighlightTool only.

Fixed: chromium:999440
Change-Id: I6bfe1f5587fea18b1aa23c389812231ac52b3b8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2150430Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759589}
parent 844fd636
...@@ -297,6 +297,10 @@ bool NodeHighlightTool::HideOnHideHighlight() { ...@@ -297,6 +297,10 @@ bool NodeHighlightTool::HideOnHideHighlight() {
return true; return true;
} }
bool NodeHighlightTool::HideOnMouseMove() {
return true;
}
void NodeHighlightTool::Draw(float scale) { void NodeHighlightTool::Draw(float scale) {
DrawNode(); DrawNode();
DrawMatchingSelector(); DrawMatchingSelector();
......
...@@ -75,6 +75,7 @@ class NodeHighlightTool : public InspectTool { ...@@ -75,6 +75,7 @@ class NodeHighlightTool : public InspectTool {
private: private:
bool ForwardEventsToOverlay() override; bool ForwardEventsToOverlay() override;
bool HideOnMouseMove() override;
bool HideOnHideHighlight() override; bool HideOnHideHighlight() override;
void Draw(float scale) override; void Draw(float scale) override;
void DrawNode(); void DrawNode();
......
...@@ -196,6 +196,10 @@ bool InspectTool::ForwardEventsToOverlay() { ...@@ -196,6 +196,10 @@ bool InspectTool::ForwardEventsToOverlay() {
return true; return true;
} }
bool InspectTool::HideOnMouseMove() {
return false;
}
bool InspectTool::HideOnHideHighlight() { bool InspectTool::HideOnHideHighlight() {
return false; return false;
} }
...@@ -759,6 +763,11 @@ WebInputEventResult InspectorOverlayAgent::HandleInputEvent( ...@@ -759,6 +763,11 @@ WebInputEventResult InspectorOverlayAgent::HandleInputEvent(
} }
} }
if (input_event.GetType() == WebInputEvent::kMouseMove &&
inspect_tool_->HideOnMouseMove()) {
PickTheRightTool();
}
return WebInputEventResult::kNotHandled; return WebInputEventResult::kNotHandled;
} }
......
...@@ -95,6 +95,7 @@ class CORE_EXPORT InspectTool : public GarbageCollected<InspectTool> { ...@@ -95,6 +95,7 @@ class CORE_EXPORT InspectTool : public GarbageCollected<InspectTool> {
virtual void Trace(Visitor* visitor); virtual void Trace(Visitor* visitor);
virtual void Dispose() {} virtual void Dispose() {}
virtual bool HideOnHideHighlight(); virtual bool HideOnHideHighlight();
virtual bool HideOnMouseMove();
protected: protected:
virtual void DoInit() {} virtual void DoInit() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment