chromium/third_party/blink/renderer/core/inspector/inspect_tools.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/inspector/inspect_tools.h"

#include "third_party/blink/public/common/input/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#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/inspector_overlay_resources_map.h"
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
#include "third_party/blink/renderer/core/css/css_color.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"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/static_node_list.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/root_frame_viewport.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/inspector/inspector_css_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_dom_agent.h"
#include "third_party/blink/renderer/core/inspector/node_content_visibility_state.h"
#include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h"
#include "third_party/blink/renderer/core/layout/hit_test_location.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/cursors.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/inspector_protocol/crdtp/json.h"
#include "ui/gfx/geometry/point_conversions.h"

namespace blink {

namespace {

static const char kInvalidOverlayCommand[] =;

InspectorHighlightContrastInfo FetchContrast(Node* node) {}

Node* HoveredNodeForPoint(LocalFrame* frame,
                          const gfx::Point& point_in_root_frame,
                          bool ignore_pointer_events_none) {}

Node* HoveredNodeForEvent(LocalFrame* frame,
                          const WebGestureEvent& event,
                          bool ignore_pointer_events_none) {}

Node* HoveredNodeForEvent(LocalFrame* frame,
                          const WebMouseEvent& event,
                          bool ignore_pointer_events_none) {}

Node* HoveredNodeForEvent(LocalFrame* frame,
                          const WebPointerEvent& event,
                          bool ignore_pointer_events_none) {}

bool IsSelfLocked(Node* node) {}

NodeContentVisibilityState DetermineSelfContentVisibilityState(Node* node) {}

std::pair<Node*, NodeContentVisibilityState> DetermineContentVisibilityState(
    Node* node) {}

}  // namespace

// SearchingForNodeTool --------------------------------------------------------

SearchingForNodeTool::SearchingForNodeTool(InspectorOverlayAgent* overlay,
                                           OverlayFrontend* frontend,
                                           InspectorDOMAgent* dom_agent,
                                           bool ua_shadow,
                                           const std::vector<uint8_t>& config)
    :{}

String SearchingForNodeTool::GetOverlayName() {}

void SearchingForNodeTool::Trace(Visitor* visitor) const {}

void SearchingForNodeTool::Draw(float scale) {}

bool SearchingForNodeTool::SupportsPersistentOverlays() {}

bool SearchingForNodeTool::HandleInputEvent(LocalFrameView* frame_view,
                                            const WebInputEvent& input_event,
                                            bool* swallow_next_mouse_up) {}

bool SearchingForNodeTool::HandleMouseMove(const WebMouseEvent& event) {}

bool SearchingForNodeTool::HandleMouseDown(const WebMouseEvent& event,
                                           bool* swallow_next_mouse_up) {}

bool SearchingForNodeTool::HandleGestureTapEvent(const WebGestureEvent& event) {}

bool SearchingForNodeTool::HandlePointerEvent(const WebPointerEvent& event) {}

void SearchingForNodeTool::NodeHighlightRequested(Node* node) {}

// QuadHighlightTool -----------------------------------------------------------

QuadHighlightTool::QuadHighlightTool(InspectorOverlayAgent* overlay,
                                     OverlayFrontend* frontend,
                                     std::unique_ptr<gfx::QuadF> quad,
                                     Color color,
                                     Color outline_color)
    :{}

String QuadHighlightTool::GetOverlayName() {}

bool QuadHighlightTool::ForwardEventsToOverlay() {}

bool QuadHighlightTool::HideOnHideHighlight() {}

void QuadHighlightTool::Draw(float scale) {}

// NodeHighlightTool -----------------------------------------------------------

NodeHighlightTool::NodeHighlightTool(
    InspectorOverlayAgent* overlay,
    OverlayFrontend* frontend,
    Member<Node> node,
    String selector_list,
    std::unique_ptr<InspectorHighlightConfig> highlight_config)
    :{}

String NodeHighlightTool::GetOverlayName() {}

bool NodeHighlightTool::ForwardEventsToOverlay() {}

bool NodeHighlightTool::SupportsPersistentOverlays() {}

bool NodeHighlightTool::HideOnHideHighlight() {}

bool NodeHighlightTool::HideOnMouseMove() {}

void NodeHighlightTool::Draw(float scale) {}

void NodeHighlightTool::DrawNode() {}

void NodeHighlightTool::DrawMatchingSelector() {}

void NodeHighlightTool::Trace(Visitor* visitor) const {}

std::unique_ptr<protocol::DictionaryValue>
NodeHighlightTool::GetNodeInspectorHighlightAsJson(
    bool append_element_info,
    bool append_distance_info) const {}

// GridHighlightTool -----------------------------------------------------------
String PersistentTool::GetOverlayName() {}

bool PersistentTool::IsEmpty() {}

void PersistentTool::SetGridConfigs(GridConfigs configs) {}

void PersistentTool::SetFlexContainerConfigs(FlexContainerConfigs configs) {}

void PersistentTool::SetScrollSnapConfigs(ScrollSnapConfigs configs) {}

void PersistentTool::SetContainerQueryConfigs(ContainerQueryConfigs configs) {}

void PersistentTool::SetIsolatedElementConfigs(IsolatedElementConfigs configs) {}

bool PersistentTool::ForwardEventsToOverlay() {}

bool PersistentTool::HideOnHideHighlight() {}

bool PersistentTool::HideOnMouseMove() {}

void PersistentTool::Draw(float scale) {}

// Accepts a message of the following format:
// {
//   highlightType: 'grid'|'flex'|'scrollSnap'|'container'|'isolatedElement',
//   highlightIndex: number,
//   newWidth: string,
//   newHeight: string,
//   resizerType: 'width'|'height'|'bidrection'
// }
// If the message is correct, sets the property inline style according to the
// message.
void PersistentTool::Dispatch(const ScriptValue& message,
                              ExceptionState& exception_state) {}

std::unique_ptr<protocol::DictionaryValue>
PersistentTool::GetGridInspectorHighlightsAsJson() const {}

void PersistentTool::Trace(Visitor* visitor) const {}

// SourceOrderTool -----------------------------------------------------------

SourceOrderTool::SourceOrderTool(
    InspectorOverlayAgent* overlay,
    OverlayFrontend* frontend,
    Node* node,
    std::unique_ptr<InspectorSourceOrderConfig> source_order_config)
    :{}

String SourceOrderTool::GetOverlayName() {}

void SourceOrderTool::Draw(float scale) {}

void SourceOrderTool::DrawNode(Node* node, int source_order_position) {}

void SourceOrderTool::DrawParentNode() {}

bool SourceOrderTool::HideOnHideHighlight() {}

bool SourceOrderTool::HideOnMouseMove() {}

std::unique_ptr<protocol::DictionaryValue>
SourceOrderTool::GetNodeInspectorSourceOrderHighlightAsJson() const {}

void SourceOrderTool::Trace(Visitor* visitor) const {}

// NearbyDistanceTool ----------------------------------------------------------

String NearbyDistanceTool::GetOverlayName() {}

bool NearbyDistanceTool::HandleMouseDown(const WebMouseEvent& event,
                                         bool* swallow_next_mouse_up) {}

bool NearbyDistanceTool::HandleMouseMove(const WebMouseEvent& event) {}

bool NearbyDistanceTool::HandleMouseUp(const WebMouseEvent& event) {}

void NearbyDistanceTool::Draw(float scale) {}

void NearbyDistanceTool::Trace(Visitor* visitor) const {}

// ShowViewSizeTool ------------------------------------------------------------

void ShowViewSizeTool::Draw(float scale) {}

String ShowViewSizeTool::GetOverlayName() {}

bool ShowViewSizeTool::ForwardEventsToOverlay() {}

// ScreenshotTool --------------------------------------------------------------

ScreenshotTool::ScreenshotTool(InspectorOverlayAgent* overlay,
                               OverlayFrontend* frontend)
    :{}

String ScreenshotTool::GetOverlayName() {}

void ScreenshotTool::Dispatch(const ScriptValue& message,
                              ExceptionState& exception_state) {}

// PausedInDebuggerTool --------------------------------------------------------

String PausedInDebuggerTool::GetOverlayName() {}

void PausedInDebuggerTool::Draw(float scale) {}

void PausedInDebuggerTool::Dispatch(const ScriptValue& message,
                                    ExceptionState& exception_state) {}

// WcoTool --------------------------------------------------------

WindowControlsOverlayTool::WindowControlsOverlayTool(
    InspectorOverlayAgent* overlay,
    OverlayFrontend* frontend,
    std::unique_ptr<protocol::DictionaryValue> wco_config)
    :{}

String WindowControlsOverlayTool::GetOverlayName() {}

void WindowControlsOverlayTool::Draw(float scale) {}

}  // namespace blink