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 19 matching lines...) Expand all Loading... |
30 #include "web/InspectorOverlayImpl.h" | 30 #include "web/InspectorOverlayImpl.h" |
31 | 31 |
32 #include "bindings/core/v8/ScriptController.h" | 32 #include "bindings/core/v8/ScriptController.h" |
33 #include "bindings/core/v8/V8InspectorOverlayHost.h" | 33 #include "bindings/core/v8/V8InspectorOverlayHost.h" |
34 #include "core/dom/Node.h" | 34 #include "core/dom/Node.h" |
35 #include "core/frame/FrameHost.h" | 35 #include "core/frame/FrameHost.h" |
36 #include "core/frame/FrameView.h" | 36 #include "core/frame/FrameView.h" |
37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
38 #include "core/frame/Settings.h" | 38 #include "core/frame/Settings.h" |
39 #include "core/input/EventHandler.h" | 39 #include "core/input/EventHandler.h" |
| 40 #include "core/inspector/InspectorCSSAgent.h" |
40 #include "core/inspector/InspectorDebuggerAgent.h" | 41 #include "core/inspector/InspectorDebuggerAgent.h" |
41 #include "core/inspector/InspectorOverlayHost.h" | 42 #include "core/inspector/InspectorOverlayHost.h" |
42 #include "core/inspector/LayoutEditor.h" | 43 #include "core/inspector/LayoutEditor.h" |
43 #include "core/layout/LayoutView.h" | 44 #include "core/layout/LayoutView.h" |
44 #include "core/loader/EmptyClients.h" | 45 #include "core/loader/EmptyClients.h" |
45 #include "core/loader/FrameLoadRequest.h" | 46 #include "core/loader/FrameLoadRequest.h" |
46 #include "core/page/ChromeClient.h" | 47 #include "core/page/ChromeClient.h" |
47 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
48 #include "platform/JSONValues.h" | 49 #include "platform/JSONValues.h" |
49 #include "platform/ScriptForbiddenScope.h" | 50 #include "platform/ScriptForbiddenScope.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 196 |
196 DEFINE_TRACE(InspectorOverlayImpl) | 197 DEFINE_TRACE(InspectorOverlayImpl) |
197 { | 198 { |
198 visitor->trace(m_highlightNode); | 199 visitor->trace(m_highlightNode); |
199 visitor->trace(m_eventTargetNode); | 200 visitor->trace(m_eventTargetNode); |
200 visitor->trace(m_overlayPage); | 201 visitor->trace(m_overlayPage); |
201 visitor->trace(m_overlayChromeClient); | 202 visitor->trace(m_overlayChromeClient); |
202 visitor->trace(m_overlayHost); | 203 visitor->trace(m_overlayHost); |
203 visitor->trace(m_debuggerAgent); | 204 visitor->trace(m_debuggerAgent); |
204 visitor->trace(m_domAgent); | 205 visitor->trace(m_domAgent); |
| 206 visitor->trace(m_cssAgent); |
205 visitor->trace(m_layoutEditor); | 207 visitor->trace(m_layoutEditor); |
206 visitor->trace(m_hoveredNodeForInspectMode); | 208 visitor->trace(m_hoveredNodeForInspectMode); |
207 } | 209 } |
208 | 210 |
209 void InspectorOverlayImpl::init(InspectorCSSAgent* cssAgent, InspectorDebuggerAg
ent* debuggerAgent, InspectorDOMAgent* domAgent) | 211 void InspectorOverlayImpl::init(InspectorCSSAgent* cssAgent, InspectorDebuggerAg
ent* debuggerAgent, InspectorDOMAgent* domAgent) |
210 { | 212 { |
211 m_debuggerAgent = debuggerAgent; | 213 m_debuggerAgent = debuggerAgent; |
212 m_domAgent = domAgent; | 214 m_domAgent = domAgent; |
213 m_cssAgent = cssAgent; | 215 m_cssAgent = cssAgent; |
214 m_overlayHost->setListener(this); | 216 m_overlayHost->setListener(this); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 606 } |
605 | 607 |
606 void InspectorOverlayImpl::overlayClearSelection(bool commitChanges) | 608 void InspectorOverlayImpl::overlayClearSelection(bool commitChanges) |
607 { | 609 { |
608 ASSERT(m_layoutEditor); | 610 ASSERT(m_layoutEditor); |
609 m_hoveredNodeForInspectMode = m_layoutEditor->element(); | 611 m_hoveredNodeForInspectMode = m_layoutEditor->element(); |
610 | 612 |
611 if (commitChanges) | 613 if (commitChanges) |
612 m_layoutEditor->commitChanges(); | 614 m_layoutEditor->commitChanges(); |
613 | 615 |
614 m_layoutEditor.clear(); | 616 if (m_layoutEditor) { |
| 617 m_layoutEditor->dispose(); |
| 618 m_layoutEditor.clear(); |
| 619 } |
615 | 620 |
616 if (m_inspectModeHighlightConfig) | 621 if (m_inspectModeHighlightConfig) |
617 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight
Config, false); | 622 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight
Config, false); |
618 | 623 |
619 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(false); | 624 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(false); |
620 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC
ursor()); | 625 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC
ursor()); |
621 } | 626 } |
622 | 627 |
623 void InspectorOverlayImpl::profilingStarted() | 628 void InspectorOverlayImpl::profilingStarted() |
624 { | 629 { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 m_domAgent->inspect(node); | 736 m_domAgent->inspect(node); |
732 | 737 |
733 if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::Sho
wLayoutEditor && !m_layoutEditor) { | 738 if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::Sho
wLayoutEditor && !m_layoutEditor) { |
734 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_dom
Agent); | 739 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_dom
Agent); |
735 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr
idden(true); | 740 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr
idden(true); |
736 highlightNode(node, *m_inspectModeHighlightConfig, false); | 741 highlightNode(node, *m_inspectModeHighlightConfig, false); |
737 } | 742 } |
738 } | 743 } |
739 | 744 |
740 } // namespace blink | 745 } // namespace blink |
OLD | NEW |