| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "platform/graphics/GraphicsContext.h" | 51 #include "platform/graphics/GraphicsContext.h" |
| 52 #include "platform/graphics/paint/CullRect.h" | 52 #include "platform/graphics/paint/CullRect.h" |
| 53 #include "platform/inspector_protocol/Values.h" | 53 #include "platform/inspector_protocol/Values.h" |
| 54 #include "platform/v8_inspector/public/V8InspectorSession.h" | 54 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 55 #include "public/platform/Platform.h" | 55 #include "public/platform/Platform.h" |
| 56 #include "public/platform/WebData.h" | 56 #include "public/platform/WebData.h" |
| 57 #include "web/PageOverlay.h" | 57 #include "web/PageOverlay.h" |
| 58 #include "web/WebInputEventConversion.h" | 58 #include "web/WebInputEventConversion.h" |
| 59 #include "web/WebLocalFrameImpl.h" | 59 #include "web/WebLocalFrameImpl.h" |
| 60 #include "web/WebViewImpl.h" | 60 #include "web/WebViewImpl.h" |
| 61 #include <memory> |
| 61 #include <v8.h> | 62 #include <v8.h> |
| 62 | 63 |
| 63 namespace blink { | 64 namespace blink { |
| 64 | 65 |
| 65 namespace { | 66 namespace { |
| 66 | 67 |
| 67 Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootFrame, b
ool ignorePointerEventsNone) | 68 Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootFrame, b
ool ignorePointerEventsNone) |
| 68 { | 69 { |
| 69 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; | 70 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; |
| 70 if (ignorePointerEventsNone) | 71 if (ignorePointerEventsNone) |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 314 |
| 314 void InspectorOverlay::highlightNode(Node* node, Node* eventTarget, const Inspec
torHighlightConfig& highlightConfig, bool omitTooltip) | 315 void InspectorOverlay::highlightNode(Node* node, Node* eventTarget, const Inspec
torHighlightConfig& highlightConfig, bool omitTooltip) |
| 315 { | 316 { |
| 316 m_nodeHighlightConfig = highlightConfig; | 317 m_nodeHighlightConfig = highlightConfig; |
| 317 m_highlightNode = node; | 318 m_highlightNode = node; |
| 318 m_eventTargetNode = eventTarget; | 319 m_eventTargetNode = eventTarget; |
| 319 m_omitTooltip = omitTooltip; | 320 m_omitTooltip = omitTooltip; |
| 320 scheduleUpdate(); | 321 scheduleUpdate(); |
| 321 } | 322 } |
| 322 | 323 |
| 323 void InspectorOverlay::setInspectMode(InspectorDOMAgent::SearchMode searchMode,
PassOwnPtr<InspectorHighlightConfig> highlightConfig) | 324 void InspectorOverlay::setInspectMode(InspectorDOMAgent::SearchMode searchMode,
std::unique_ptr<InspectorHighlightConfig> highlightConfig) |
| 324 { | 325 { |
| 325 if (m_layoutEditor) | 326 if (m_layoutEditor) |
| 326 overlayClearSelection(true); | 327 overlayClearSelection(true); |
| 327 | 328 |
| 328 m_inspectMode = searchMode; | 329 m_inspectMode = searchMode; |
| 329 scheduleUpdate(); | 330 scheduleUpdate(); |
| 330 | 331 |
| 331 if (searchMode != InspectorDOMAgent::NotSearching) { | 332 if (searchMode != InspectorDOMAgent::NotSearching) { |
| 332 m_inspectModeHighlightConfig = std::move(highlightConfig); | 333 m_inspectModeHighlightConfig = std::move(highlightConfig); |
| 333 } else { | 334 } else { |
| 334 m_hoveredNodeForInspectMode.clear(); | 335 m_hoveredNodeForInspectMode.clear(); |
| 335 hideHighlight(); | 336 hideHighlight(); |
| 336 } | 337 } |
| 337 } | 338 } |
| 338 | 339 |
| 339 void InspectorOverlay::setInspectedNode(Node* node) | 340 void InspectorOverlay::setInspectedNode(Node* node) |
| 340 { | 341 { |
| 341 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor
&& m_layoutEditor->element() == node)) | 342 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor
&& m_layoutEditor->element() == node)) |
| 342 return; | 343 return; |
| 343 | 344 |
| 344 if (m_layoutEditor) { | 345 if (m_layoutEditor) { |
| 345 m_layoutEditor->commitChanges(); | 346 m_layoutEditor->commitChanges(); |
| 346 m_layoutEditor.clear(); | 347 m_layoutEditor.clear(); |
| 347 } | 348 } |
| 348 initializeLayoutEditorIfNeeded(node); | 349 initializeLayoutEditorIfNeeded(node); |
| 349 } | 350 } |
| 350 | 351 |
| 351 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector
HighlightConfig& highlightConfig) | 352 void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const Insp
ectorHighlightConfig& highlightConfig) |
| 352 { | 353 { |
| 353 m_quadHighlightConfig = highlightConfig; | 354 m_quadHighlightConfig = highlightConfig; |
| 354 m_highlightQuad = std::move(quad); | 355 m_highlightQuad = std::move(quad); |
| 355 m_omitTooltip = false; | 356 m_omitTooltip = false; |
| 356 scheduleUpdate(); | 357 scheduleUpdate(); |
| 357 } | 358 } |
| 358 | 359 |
| 359 bool InspectorOverlay::isEmpty() | 360 bool InspectorOverlay::isEmpty() |
| 360 { | 361 { |
| 361 if (m_suspendCount) | 362 if (m_suspendCount) |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 778 |
| 778 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | 779 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
| 779 { | 780 { |
| 780 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) | 781 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) |
| 781 return; | 782 return; |
| 782 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); | 783 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); |
| 783 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); | 784 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); |
| 784 } | 785 } |
| 785 | 786 |
| 786 } // namespace blink | 787 } // namespace blink |
| OLD | NEW |