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> | |
62 #include <v8.h> | 61 #include <v8.h> |
63 | 62 |
64 namespace blink { | 63 namespace blink { |
65 | 64 |
66 namespace { | 65 namespace { |
67 | 66 |
68 Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootFrame, b
ool ignorePointerEventsNone) | 67 Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootFrame, b
ool ignorePointerEventsNone) |
69 { | 68 { |
70 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; | 69 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; |
71 if (ignorePointerEventsNone) | 70 if (ignorePointerEventsNone) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 313 |
315 void InspectorOverlay::highlightNode(Node* node, Node* eventTarget, const Inspec
torHighlightConfig& highlightConfig, bool omitTooltip) | 314 void InspectorOverlay::highlightNode(Node* node, Node* eventTarget, const Inspec
torHighlightConfig& highlightConfig, bool omitTooltip) |
316 { | 315 { |
317 m_nodeHighlightConfig = highlightConfig; | 316 m_nodeHighlightConfig = highlightConfig; |
318 m_highlightNode = node; | 317 m_highlightNode = node; |
319 m_eventTargetNode = eventTarget; | 318 m_eventTargetNode = eventTarget; |
320 m_omitTooltip = omitTooltip; | 319 m_omitTooltip = omitTooltip; |
321 scheduleUpdate(); | 320 scheduleUpdate(); |
322 } | 321 } |
323 | 322 |
324 void InspectorOverlay::setInspectMode(InspectorDOMAgent::SearchMode searchMode,
std::unique_ptr<InspectorHighlightConfig> highlightConfig) | 323 void InspectorOverlay::setInspectMode(InspectorDOMAgent::SearchMode searchMode,
PassOwnPtr<InspectorHighlightConfig> highlightConfig) |
325 { | 324 { |
326 if (m_layoutEditor) | 325 if (m_layoutEditor) |
327 overlayClearSelection(true); | 326 overlayClearSelection(true); |
328 | 327 |
329 m_inspectMode = searchMode; | 328 m_inspectMode = searchMode; |
330 scheduleUpdate(); | 329 scheduleUpdate(); |
331 | 330 |
332 if (searchMode != InspectorDOMAgent::NotSearching) { | 331 if (searchMode != InspectorDOMAgent::NotSearching) { |
333 m_inspectModeHighlightConfig = std::move(highlightConfig); | 332 m_inspectModeHighlightConfig = std::move(highlightConfig); |
334 } else { | 333 } else { |
335 m_hoveredNodeForInspectMode.clear(); | 334 m_hoveredNodeForInspectMode.clear(); |
336 hideHighlight(); | 335 hideHighlight(); |
337 } | 336 } |
338 } | 337 } |
339 | 338 |
340 void InspectorOverlay::setInspectedNode(Node* node) | 339 void InspectorOverlay::setInspectedNode(Node* node) |
341 { | 340 { |
342 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor
&& m_layoutEditor->element() == node)) | 341 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor
&& m_layoutEditor->element() == node)) |
343 return; | 342 return; |
344 | 343 |
345 if (m_layoutEditor) { | 344 if (m_layoutEditor) { |
346 m_layoutEditor->commitChanges(); | 345 m_layoutEditor->commitChanges(); |
347 m_layoutEditor.clear(); | 346 m_layoutEditor.clear(); |
348 } | 347 } |
349 initializeLayoutEditorIfNeeded(node); | 348 initializeLayoutEditorIfNeeded(node); |
350 } | 349 } |
351 | 350 |
352 void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const Insp
ectorHighlightConfig& highlightConfig) | 351 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector
HighlightConfig& highlightConfig) |
353 { | 352 { |
354 m_quadHighlightConfig = highlightConfig; | 353 m_quadHighlightConfig = highlightConfig; |
355 m_highlightQuad = std::move(quad); | 354 m_highlightQuad = std::move(quad); |
356 m_omitTooltip = false; | 355 m_omitTooltip = false; |
357 scheduleUpdate(); | 356 scheduleUpdate(); |
358 } | 357 } |
359 | 358 |
360 bool InspectorOverlay::isEmpty() | 359 bool InspectorOverlay::isEmpty() |
361 { | 360 { |
362 if (m_suspendCount) | 361 if (m_suspendCount) |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 777 |
779 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | 778 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
780 { | 779 { |
781 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) | 780 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) |
782 return; | 781 return; |
783 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); | 782 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); |
784 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); | 783 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); |
785 } | 784 } |
786 | 785 |
787 } // namespace blink | 786 } // namespace blink |
OLD | NEW |