diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc b/chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc index 502c7676fca..f3eecc89caa 100644 --- a/chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc +++ b/chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc @@ -9,7 +9,7 @@ #include "third_party/blink/public/common/input/web_keyboard_event.h" #include "third_party/blink/public/common/input/web_pointer_event.h" #include "third_party/blink/public/platform/web_input_event_result.h" -#include "third_party/blink/public/resources/grit/blink_resources.h" +#include "third_party/blink/public/resources/grit/inspector_overlay_resources_map.h" #include "third_party/blink/renderer/core/css/css_color_value.h" #include "third_party/blink/renderer/core/css/css_computed_style_declaration.h" #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" @@ -115,7 +115,7 @@ SearchingForNodeTool::SearchingForNodeTool(InspectorDOMAgent* dom_agent, InspectorOverlayAgent::ToHighlightConfig(highlight_config.get()); } -void SearchingForNodeTool::Trace(Visitor* visitor) { +void SearchingForNodeTool::Trace(Visitor* visitor) const { InspectTool::Trace(visitor); visitor->Trace(dom_agent_); visitor->Trace(hovered_node_); @@ -286,7 +286,7 @@ NodeHighlightTool::NodeHighlightTool( } else { node_ = node; } - contrast_info_ = FetchContrast(node); + contrast_info_ = FetchContrast(node_); } bool NodeHighlightTool::ForwardEventsToOverlay() { @@ -311,11 +311,10 @@ void NodeHighlightTool::DrawNode() { highlight_config_->show_info && node_->GetLayoutObject() && node_->GetDocument().GetFrame(); - InspectorHighlight highlight(node_.Get(), *highlight_config_, contrast_info_, - append_element_info, false, is_locked_ancestor_); - std::unique_ptr<protocol::DictionaryValue> highlight_json = - highlight.AsProtocolValue(); - overlay_->EvaluateInOverlay("drawHighlight", std::move(highlight_json)); + overlay_->EvaluateInOverlay( + "drawHighlight", + GetNodeInspectorHighlightAsJson(append_element_info, + false /* append_distance_info */)); } void NodeHighlightTool::DrawMatchingSelector() { @@ -343,15 +342,25 @@ void NodeHighlightTool::DrawMatchingSelector() { } } -void NodeHighlightTool::Trace(Visitor* visitor) { +void NodeHighlightTool::Trace(Visitor* visitor) const { InspectTool::Trace(visitor); visitor->Trace(node_); } +std::unique_ptr<protocol::DictionaryValue> +NodeHighlightTool::GetNodeInspectorHighlightAsJson( + bool append_element_info, + bool append_distance_info) const { + InspectorHighlight highlight(node_.Get(), *highlight_config_, contrast_info_, + append_element_info, append_distance_info, + is_locked_ancestor_); + return highlight.AsProtocolValue(); +} + // NearbyDistanceTool ---------------------------------------------------------- int NearbyDistanceTool::GetDataResourceId() { - return IDR_INSPECT_TOOL_DISTANCES_HTML; + return IDR_INSPECT_TOOL_DISTANCES_JS; } bool NearbyDistanceTool::HandleMouseDown(const WebMouseEvent& event, @@ -409,7 +418,7 @@ void NearbyDistanceTool::Draw(float scale) { overlay_->EvaluateInOverlay("drawDistances", highlight.AsProtocolValue()); } -void NearbyDistanceTool::Trace(Visitor* visitor) { +void NearbyDistanceTool::Trace(Visitor* visitor) const { InspectTool::Trace(visitor); visitor->Trace(hovered_node_); } @@ -421,7 +430,7 @@ void ShowViewSizeTool::Draw(float scale) { } int ShowViewSizeTool::GetDataResourceId() { - return IDR_INSPECT_TOOL_VIEWPORT_SIZE_HTML; + return IDR_INSPECT_TOOL_VIEWPORT_SIZE_JS; } bool ShowViewSizeTool::ForwardEventsToOverlay() { @@ -438,7 +447,7 @@ void ScreenshotTool::DoInit() { } int ScreenshotTool::GetDataResourceId() { - return IDR_INSPECT_TOOL_SCREENSHOT_HTML; + return IDR_INSPECT_TOOL_SCREENSHOT_JS; } void ScreenshotTool::Dispatch(const String& message) { @@ -521,7 +530,7 @@ void ScreenshotTool::Dispatch(const String& message) { // PausedInDebuggerTool -------------------------------------------------------- int PausedInDebuggerTool::GetDataResourceId() { - return IDR_INSPECT_TOOL_PAUSED_HTML; + return IDR_INSPECT_TOOL_PAUSED_JS; } void PausedInDebuggerTool::Draw(float scale) { |