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

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: Address comment 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..a44c0153c0c7ea85a0588bab41ed160a45899ee5 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -337,6 +337,18 @@ 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) {
+ m_layoutEditor->commitChanges();
+ m_layoutEditor.clear();
+ }
+ initializeLayoutEditorIfNeeded(node);
+}
+
void InspectorOverlay::highlightQuad(PassOwnPtr<FloatQuad> quad, const InspectorHighlightConfig& highlightConfig)
{
m_quadHighlightConfig = highlightConfig;
@@ -725,10 +737,16 @@ void InspectorOverlay::inspect(Node* node)
if (m_domAgent)
m_domAgent->inspect(node);
+ initializeLayoutEditorIfNeeded(node);
+ if (m_layoutEditor)
+ hideHighlight();
+}
+
+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);
- hideHighlight();
}
}
« 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