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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 DEFINE_INLINE_VIRTUAL_TRACE() | 132 DEFINE_INLINE_VIRTUAL_TRACE() |
133 { | 133 { |
134 visitor->trace(m_client); | 134 visitor->trace(m_client); |
135 visitor->trace(m_overlay); | 135 visitor->trace(m_overlay); |
136 EmptyChromeClient::trace(visitor); | 136 EmptyChromeClient::trace(visitor); |
137 } | 137 } |
138 | 138 |
139 void setCursor(const Cursor& cursor) override | 139 void setCursor(const Cursor& cursor) override |
140 { | 140 { |
141 m_client->setCursor(cursor); | 141 toChromeClientImpl(m_client)->setCursorOverridden(false); |
| 142 toChromeClientImpl(m_client)->setCursor(cursor); |
| 143 bool overrideCursor = m_overlay->m_inspectMode == InspectorDOMAgent::Sho
wLayoutEditor && !m_overlay->m_searchingInLayoutEditor; |
| 144 toChromeClientImpl(m_client)->setCursorOverridden(overrideCursor); |
142 } | 145 } |
143 | 146 |
144 void setToolTip(const String& tooltip, TextDirection direction) override | 147 void setToolTip(const String& tooltip, TextDirection direction) override |
145 { | 148 { |
146 m_client->setToolTip(tooltip, direction); | 149 m_client->setToolTip(tooltip, direction); |
147 } | 150 } |
148 | 151 |
149 void invalidateRect(const IntRect&) override | 152 void invalidateRect(const IntRect&) override |
150 { | 153 { |
151 m_overlay->invalidate(); | 154 m_overlay->invalidate(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 { | 314 { |
312 m_nodeHighlightConfig = highlightConfig; | 315 m_nodeHighlightConfig = highlightConfig; |
313 m_highlightNode = node; | 316 m_highlightNode = node; |
314 m_eventTargetNode = eventTarget; | 317 m_eventTargetNode = eventTarget; |
315 m_omitTooltip = omitTooltip; | 318 m_omitTooltip = omitTooltip; |
316 update(); | 319 update(); |
317 } | 320 } |
318 | 321 |
319 void InspectorOverlayImpl::setInspectMode(InspectorDOMAgent::SearchMode searchMo
de, PassOwnPtr<InspectorHighlightConfig> highlightConfig) | 322 void InspectorOverlayImpl::setInspectMode(InspectorDOMAgent::SearchMode searchMo
de, PassOwnPtr<InspectorHighlightConfig> highlightConfig) |
320 { | 323 { |
| 324 if (m_inspectMode == InspectorDOMAgent::ShowLayoutEditor && !m_searchingInLa
youtEditor) |
| 325 overlayClearSelection(true); |
| 326 |
321 m_inspectMode = searchMode; | 327 m_inspectMode = searchMode; |
322 update(); | 328 update(); |
323 | 329 |
324 if (searchMode != InspectorDOMAgent::NotSearching) { | 330 if (searchMode != InspectorDOMAgent::NotSearching) { |
325 m_inspectModeHighlightConfig = highlightConfig; | 331 m_inspectModeHighlightConfig = highlightConfig; |
326 } else { | 332 } else { |
327 m_searchingInLayoutEditor = true; | 333 m_searchingInLayoutEditor = true; |
328 m_hoveredNodeForInspectMode.clear(); | 334 m_hoveredNodeForInspectMode.clear(); |
329 hideHighlight(); | 335 hideHighlight(); |
330 } | 336 } |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor) | 584 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor) |
579 return; | 585 return; |
580 | 586 |
581 m_searchingInLayoutEditor = true; | 587 m_searchingInLayoutEditor = true; |
582 if (m_layoutEditor->node() && m_inspectModeHighlightConfig) { | 588 if (m_layoutEditor->node() && m_inspectModeHighlightConfig) { |
583 m_hoveredNodeForInspectMode = m_layoutEditor->node(); | 589 m_hoveredNodeForInspectMode = m_layoutEditor->node(); |
584 highlightNode(m_layoutEditor->node(), *m_inspectModeHighlightConfig, fal
se); | 590 highlightNode(m_layoutEditor->node(), *m_inspectModeHighlightConfig, fal
se); |
585 } | 591 } |
586 | 592 |
587 m_layoutEditor->clearSelection(commitChanges); | 593 m_layoutEditor->clearSelection(commitChanges); |
| 594 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(false); |
| 595 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC
ursor()); |
588 } | 596 } |
589 | 597 |
590 void InspectorOverlayImpl::profilingStarted() | 598 void InspectorOverlayImpl::profilingStarted() |
591 { | 599 { |
592 if (!m_suspendCount++) | 600 if (!m_suspendCount++) |
593 clear(); | 601 clear(); |
594 } | 602 } |
595 | 603 |
596 void InspectorOverlayImpl::profilingStopped() | 604 void InspectorOverlayImpl::profilingStopped() |
597 { | 605 { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 return false; | 688 return false; |
681 Node* node = hoveredNodeForEvent(m_webViewImpl->mainFrameImpl()->frame(), ev
ent, false); | 689 Node* node = hoveredNodeForEvent(m_webViewImpl->mainFrameImpl()->frame(), ev
ent, false); |
682 if (node && m_inspectModeHighlightConfig) { | 690 if (node && m_inspectModeHighlightConfig) { |
683 highlightNode(node, *m_inspectModeHighlightConfig, false); | 691 highlightNode(node, *m_inspectModeHighlightConfig, false); |
684 inspect(node); | 692 inspect(node); |
685 return true; | 693 return true; |
686 } | 694 } |
687 return false; | 695 return false; |
688 } | 696 } |
689 | 697 |
690 | |
691 bool InspectorOverlayImpl::shouldSearchForNode() | 698 bool InspectorOverlayImpl::shouldSearchForNode() |
692 { | 699 { |
693 return !(m_inspectMode == InspectorDOMAgent::NotSearching || (m_inspectMode
== InspectorDOMAgent::ShowLayoutEditor && !m_searchingInLayoutEditor)); | 700 return !(m_inspectMode == InspectorDOMAgent::NotSearching || (m_inspectMode
== InspectorDOMAgent::ShowLayoutEditor && !m_searchingInLayoutEditor)); |
694 } | 701 } |
695 | 702 |
696 void InspectorOverlayImpl::inspect(Node* node) | 703 void InspectorOverlayImpl::inspect(Node* node) |
697 { | 704 { |
698 if (m_domAgent) | 705 if (m_domAgent) |
699 m_domAgent->inspect(node); | 706 m_domAgent->inspect(node); |
700 | 707 |
701 if (m_layoutEditor && m_inspectMode == InspectorDOMAgent::ShowLayoutEditor &
& m_searchingInLayoutEditor) { | 708 if (m_layoutEditor && m_inspectMode == InspectorDOMAgent::ShowLayoutEditor &
& m_searchingInLayoutEditor) { |
702 m_searchingInLayoutEditor = false; | 709 m_searchingInLayoutEditor = false; |
703 m_layoutEditor->selectNode(node); | 710 m_layoutEditor->selectNode(node); |
| 711 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr
idden(true); |
704 highlightNode(node, *m_inspectModeHighlightConfig, false); | 712 highlightNode(node, *m_inspectModeHighlightConfig, false); |
705 } | 713 } |
706 } | 714 } |
707 | 715 |
708 } // namespace blink | 716 } // namespace blink |
OLD | NEW |