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

Unified Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1204453002: Devtools: Create layout editor experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/web/InspectorOverlayImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/InspectorOverlayImpl.cpp
diff --git a/Source/web/InspectorOverlayImpl.cpp b/Source/web/InspectorOverlayImpl.cpp
index b6599ef8bc0710cba3bebb47971336da5ace567e..6e729a5626cd45dda604d3e558aab7bf94a0773c 100644
--- a/Source/web/InspectorOverlayImpl.cpp
+++ b/Source/web/InspectorOverlayImpl.cpp
@@ -38,6 +38,7 @@
#include "core/frame/Settings.h"
#include "core/input/EventHandler.h"
#include "core/inspector/InspectorOverlayHost.h"
+#include "core/inspector/LayoutEditor.h"
#include "core/loader/EmptyClients.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/page/ChromeClient.h"
@@ -223,6 +224,7 @@ void InspectorOverlayImpl::hideHighlight()
m_highlightNode.clear();
m_eventTargetNode.clear();
m_highlightQuad.clear();
+ m_layoutEditor.clear();
update();
}
@@ -230,6 +232,8 @@ void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const In
{
m_nodeHighlightConfig = highlightConfig;
m_highlightNode = node;
+ if (highlightConfig.showLayoutEditor)
+ m_layoutEditor = LayoutEditor::create(node);
m_eventTargetNode = eventTarget;
m_omitTooltip = omitTooltip;
update();
@@ -306,7 +310,14 @@ void InspectorOverlayImpl::drawNodeHighlight()
InspectorHighlight highlight(m_highlightNode.get(), m_nodeHighlightConfig, appendElementInfo);
if (m_eventTargetNode)
highlight.appendEventTargetQuads(m_eventTargetNode.get(), m_nodeHighlightConfig);
- evaluateInOverlay("drawHighlight", highlight.asJSONObject());
+
+ RefPtr<JSONObject> highlightJSON = highlight.asJSONObject();
+ if (m_layoutEditor) {
+ RefPtr<JSONObject> layoutEditorInfo = m_layoutEditor->buildJSONInfo();
+ if (layoutEditorInfo)
+ highlightJSON->setObject("layoutEditorInfo", layoutEditorInfo.release());
+ }
+ evaluateInOverlay("drawHighlight", highlightJSON.release());
}
void InspectorOverlayImpl::drawQuadHighlight()
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698