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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 }; | 171 }; |
172 | 172 |
173 | 173 |
174 InspectorOverlay::InspectorOverlay(WebViewImpl* webViewImpl) | 174 InspectorOverlay::InspectorOverlay(WebViewImpl* webViewImpl) |
175 : m_webViewImpl(webViewImpl) | 175 : m_webViewImpl(webViewImpl) |
176 , m_overlayHost(InspectorOverlayHost::create()) | 176 , m_overlayHost(InspectorOverlayHost::create()) |
177 , m_drawViewSize(false) | 177 , m_drawViewSize(false) |
178 , m_resizeTimerActive(false) | 178 , m_resizeTimerActive(false) |
179 , m_omitTooltip(false) | 179 , m_omitTooltip(false) |
180 , m_timer(this, &InspectorOverlay::onTimer) | 180 , m_timer(this, &InspectorOverlay::onTimer) |
181 , m_suspendCount(0) | 181 , m_suspended(false) |
182 , m_inLayout(false) | 182 , m_inLayout(false) |
183 , m_needsUpdate(false) | 183 , m_needsUpdate(false) |
184 , m_inspectMode(InspectorDOMAgent::NotSearching) | 184 , m_inspectMode(InspectorDOMAgent::NotSearching) |
185 { | 185 { |
186 } | 186 } |
187 | 187 |
188 InspectorOverlay::~InspectorOverlay() | 188 InspectorOverlay::~InspectorOverlay() |
189 { | 189 { |
190 DCHECK(!m_overlayPage); | 190 DCHECK(!m_overlayPage); |
191 } | 191 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const Insp
ectorHighlightConfig& highlightConfig) | 347 void InspectorOverlay::highlightQuad(std::unique_ptr<FloatQuad> quad, const Insp
ectorHighlightConfig& highlightConfig) |
348 { | 348 { |
349 m_quadHighlightConfig = highlightConfig; | 349 m_quadHighlightConfig = highlightConfig; |
350 m_highlightQuad = std::move(quad); | 350 m_highlightQuad = std::move(quad); |
351 m_omitTooltip = false; | 351 m_omitTooltip = false; |
352 scheduleUpdate(); | 352 scheduleUpdate(); |
353 } | 353 } |
354 | 354 |
355 bool InspectorOverlay::isEmpty() | 355 bool InspectorOverlay::isEmpty() |
356 { | 356 { |
357 if (m_suspendCount) | 357 if (m_suspended) |
358 return true; | 358 return true; |
359 bool hasVisibleElements = m_highlightNode || m_eventTargetNode || m_highligh
tQuad || (m_resizeTimerActive && m_drawViewSize) || !m_pausedInDebuggerMessage.
isNull(); | 359 bool hasVisibleElements = m_highlightNode || m_eventTargetNode || m_highligh
tQuad || (m_resizeTimerActive && m_drawViewSize) || !m_pausedInDebuggerMessage.
isNull(); |
360 return !hasVisibleElements && m_inspectMode == InspectorDOMAgent::NotSearchi
ng; | 360 return !hasVisibleElements && m_inspectMode == InspectorDOMAgent::NotSearchi
ng; |
361 } | 361 } |
362 | 362 |
363 void InspectorOverlay::scheduleUpdate() | 363 void InspectorOverlay::scheduleUpdate() |
364 { | 364 { |
365 if (isEmpty()) { | 365 if (isEmpty()) { |
366 if (m_pageOverlay) | 366 if (m_pageOverlay) |
367 m_pageOverlay.reset(); | 367 m_pageOverlay.reset(); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 if (m_inspectModeHighlightConfig) | 666 if (m_inspectModeHighlightConfig) |
667 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight
Config, false); | 667 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight
Config, false); |
668 | 668 |
669 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(false); | 669 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(false); |
670 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC
ursor(), overlayMainFrame()); | 670 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC
ursor(), overlayMainFrame()); |
671 } | 671 } |
672 | 672 |
673 void InspectorOverlay::suspend() | 673 void InspectorOverlay::suspend() |
674 { | 674 { |
675 if (!m_suspendCount++) | 675 if (!m_suspended) { |
| 676 m_suspended = true; |
676 clearInternal(); | 677 clearInternal(); |
| 678 } |
677 } | 679 } |
678 | 680 |
679 void InspectorOverlay::resume() | 681 void InspectorOverlay::resume() |
680 { | 682 { |
681 --m_suspendCount; | 683 m_suspended = false; |
682 } | 684 } |
683 | 685 |
684 void InspectorOverlay::pageLayoutInvalidated(bool resized) | 686 void InspectorOverlay::pageLayoutInvalidated(bool resized) |
685 { | 687 { |
686 if (resized && m_drawViewSize) { | 688 if (resized && m_drawViewSize) { |
687 m_resizeTimerActive = true; | 689 m_resizeTimerActive = true; |
688 m_timer.startOneShot(1, BLINK_FROM_HERE); | 690 m_timer.startOneShot(1, BLINK_FROM_HERE); |
689 } | 691 } |
690 scheduleUpdate(); | 692 scheduleUpdate(); |
691 } | 693 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 | 790 |
789 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | 791 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
790 { | 792 { |
791 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) | 793 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) |
792 return; | 794 return; |
793 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); | 795 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); |
794 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); | 796 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); |
795 } | 797 } |
796 | 798 |
797 } // namespace blink | 799 } // namespace blink |
OLD | NEW |