Chromium Code Reviews| 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 overlayClearSelection(true); | |
|
dgozman
2015/09/30 23:13:34
Replace with commit, dispose and clear.
sergeyv
2015/09/30 23:35:30
Done.
| |
| 347 initializeLayoutEditorIfNeeded(node); | |
| 348 } | |
| 349 | |
| 340 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector HighlightConfig& highlightConfig) | 350 void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspector HighlightConfig& highlightConfig) |
| 341 { | 351 { |
| 342 m_quadHighlightConfig = highlightConfig; | 352 m_quadHighlightConfig = highlightConfig; |
| 343 m_highlightQuad = quad; | 353 m_highlightQuad = quad; |
| 344 m_omitTooltip = false; | 354 m_omitTooltip = false; |
| 345 scheduleUpdate(); | 355 scheduleUpdate(); |
| 346 } | 356 } |
| 347 | 357 |
| 348 bool InspectorOverlay::isEmpty() | 358 bool InspectorOverlay::isEmpty() |
| 349 { | 359 { |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 718 bool InspectorOverlay::shouldSearchForNode() | 728 bool InspectorOverlay::shouldSearchForNode() |
| 719 { | 729 { |
| 720 return m_inspectMode != InspectorDOMAgent::NotSearching && !m_layoutEditor; | 730 return m_inspectMode != InspectorDOMAgent::NotSearching && !m_layoutEditor; |
| 721 } | 731 } |
| 722 | 732 |
| 723 void InspectorOverlay::inspect(Node* node) | 733 void InspectorOverlay::inspect(Node* node) |
| 724 { | 734 { |
| 725 if (m_domAgent) | 735 if (m_domAgent) |
| 726 m_domAgent->inspect(node); | 736 m_domAgent->inspect(node); |
| 727 | 737 |
| 738 initializeLayoutEditorIfNeeded(node); | |
| 739 } | |
| 740 | |
| 741 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | |
| 742 { | |
| 728 if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::Sho wLayoutEditor && !m_layoutEditor) { | 743 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()); | 744 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_dom Agent, &overlayMainFrame()->script()); |
| 730 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr idden(true); | 745 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr idden(true); |
| 731 hideHighlight(); | 746 hideHighlight(); |
| 732 } | 747 } |
| 733 } | 748 } |
| 734 | 749 |
| 735 } // namespace blink | 750 } // namespace blink |
| OLD | NEW |