| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 scheduleUpdate(); | 330 scheduleUpdate(); |
| 331 | 331 |
| 332 if (searchMode != InspectorDOMAgent::NotSearching) { | 332 if (searchMode != InspectorDOMAgent::NotSearching) { |
| 333 m_inspectModeHighlightConfig = highlightConfig; | 333 m_inspectModeHighlightConfig = highlightConfig; |
| 334 } else { | 334 } else { |
| 335 m_hoveredNodeForInspectMode.clear(); | 335 m_hoveredNodeForInspectMode.clear(); |
| 336 hideHighlight(); | 336 hideHighlight(); |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 void InspectorOverlay::setInspectedNode(Node* node) |
| 341 { |
| 342 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor
&& m_layoutEditor->element() == node)) |
| 343 return; |
| 344 |
| 345 if (m_layoutEditor) { |
| 346 m_layoutEditor->commitChanges(); |
| 347 m_layoutEditor.clear(); |
| 348 } |
| 349 initializeLayoutEditorIfNeeded(node); |
| 350 } |
| 351 |
| 340 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector
HighlightConfig& highlightConfig) | 352 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector
HighlightConfig& highlightConfig) |
| 341 { | 353 { |
| 342 m_quadHighlightConfig = highlightConfig; | 354 m_quadHighlightConfig = highlightConfig; |
| 343 m_highlightQuad = quad; | 355 m_highlightQuad = quad; |
| 344 m_omitTooltip = false; | 356 m_omitTooltip = false; |
| 345 scheduleUpdate(); | 357 scheduleUpdate(); |
| 346 } | 358 } |
| 347 | 359 |
| 348 bool InspectorOverlay::isEmpty() | 360 bool InspectorOverlay::isEmpty() |
| 349 { | 361 { |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 bool InspectorOverlay::shouldSearchForNode() | 730 bool InspectorOverlay::shouldSearchForNode() |
| 719 { | 731 { |
| 720 return m_inspectMode != InspectorDOMAgent::NotSearching && !m_layoutEditor; | 732 return m_inspectMode != InspectorDOMAgent::NotSearching && !m_layoutEditor; |
| 721 } | 733 } |
| 722 | 734 |
| 723 void InspectorOverlay::inspect(Node* node) | 735 void InspectorOverlay::inspect(Node* node) |
| 724 { | 736 { |
| 725 if (m_domAgent) | 737 if (m_domAgent) |
| 726 m_domAgent->inspect(node); | 738 m_domAgent->inspect(node); |
| 727 | 739 |
| 740 initializeLayoutEditorIfNeeded(node); |
| 741 if (m_layoutEditor) |
| 742 hideHighlight(); |
| 743 } |
| 744 |
| 745 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
| 746 { |
| 728 if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::Sho
wLayoutEditor && !m_layoutEditor) { | 747 if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::Sho
wLayoutEditor && !m_layoutEditor) { |
| 729 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_dom
Agent, &overlayMainFrame()->script()); | 748 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_dom
Agent, &overlayMainFrame()->script()); |
| 730 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr
idden(true); | 749 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr
idden(true); |
| 731 hideHighlight(); | |
| 732 } | 750 } |
| 733 } | 751 } |
| 734 | 752 |
| 735 } // namespace blink | 753 } // namespace blink |
| OLD | NEW |