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

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
Index: Source/web/InspectorOverlayImpl.cpp
diff --git a/Source/web/InspectorOverlayImpl.cpp b/Source/web/InspectorOverlayImpl.cpp
index b6599ef8bc0710cba3bebb47971336da5ace567e..ebaefa44066c1078c86e9bff0fdb64c8722b8eab 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/LayoutWYSIWYGEditor.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_layoutWYSIWIGEditor.clear();
update();
}
@@ -230,6 +232,8 @@ void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const In
{
m_nodeHighlightConfig = highlightConfig;
m_highlightNode = node;
+ if (highlightConfig.showWYSIWYGEditor)
+ m_layoutWYSIWIGEditor = adoptPtr(new LayoutWYSIWIGEditor(node));
dgozman 2015/06/23 14:00:30 adoptPtrWillBeNoop
sergeyv 2015/06/23 16:36:53 It's gone now
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();
dgozman 2015/06/23 14:00:30 nit: two spaces
sergeyv 2015/06/23 16:36:52 Done.
+ if (m_layoutWYSIWIGEditor) {
+ RefPtr<JSONObject> wysiwygInfo = m_layoutWYSIWIGEditor->buildJSONInfo();
+ if (wysiwygInfo)
+ highlightJSON->setObject("wysiwygInfo", wysiwygInfo.release());
+ }
+ evaluateInOverlay("drawHighlight", highlightJSON.release());
}
void InspectorOverlayImpl::drawQuadHighlight()
« Source/core/inspector/LayoutWYSIWYGEditor.cpp ('K') | « Source/web/InspectorOverlayImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698