Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 1378193002: Devtools[LayoutEditor]: Keep LayoutEditor in sync with a node selected in ElementsPanel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/InspectorOverlay.cpp
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp
index 357987e076fcead2adaf1cccb8c473302f3e26d4..1341c857957e5c8a7bfaefeba86f869cd9f371cf 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -337,6 +337,16 @@ void InspectorOverlay::setInspectMode(InspectorDOMAgent::SearchMode searchMode,
}
}
+void InspectorOverlay::setInspectedNode(Node* node)
+{
+ if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || (m_layoutEditor && m_layoutEditor->element() == node))
+ return;
+
+ if (m_layoutEditor)
+ overlayClearSelection(true);
dgozman 2015/09/30 23:13:34 Replace with commit, dispose and clear.
sergeyv 2015/09/30 23:35:30 Done.
+ initializeLayoutEditorIfNeeded(node);
+}
+
void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const InspectorHighlightConfig& highlightConfig)
{
m_quadHighlightConfig = highlightConfig;
@@ -725,6 +735,11 @@ void InspectorOverlay::inspect(Node* node)
if (m_domAgent)
m_domAgent->inspect(node);
+ initializeLayoutEditorIfNeeded(node);
+}
+
+void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node)
+{
if (node && node->isElementNode() && m_inspectMode == InspectorDOMAgent::ShowLayoutEditor && !m_layoutEditor) {
m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgent, &overlayMainFrame()->script());
toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridden(true);
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698