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

Unified Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1153503010: Devtools: Margin resizer in overlay 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') | Source/web/WebDevToolsAgentImpl.cpp » ('j') | 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 4505ea256c05f260c36c16bb24c26a762001bdcb..abe2c24cbf28e067ea9be269c29d3367d5b7a4ed 100644
--- a/Source/web/InspectorOverlayImpl.cpp
+++ b/Source/web/InspectorOverlayImpl.cpp
@@ -42,6 +42,7 @@
#include "core/page/ChromeClient.h"
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
+#include "core/style/ComputedStyle.h"
#include "platform/JSONValues.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/graphics/GraphicsContext.h"
@@ -105,6 +106,7 @@ public:
void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) override { }
void showAndHideViewSize(bool showGrid) override { }
void setListener(InspectorOverlay::Listener* listener) override { }
+ void setCSSListener(InspectorOverlay::CSSListener* listener) override { }
void suspendUpdates() override { }
void resumeUpdates() override { }
void clear() override { }
@@ -135,6 +137,7 @@ InspectorOverlayImpl::InspectorOverlayImpl(WebViewImpl* webViewImpl)
, m_updating(false)
{
m_overlayHost->setListener(this);
+ m_overlayHost->setCSSListener(this);
}
InspectorOverlayImpl::~InspectorOverlayImpl()
@@ -232,6 +235,9 @@ void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const In
m_highlightNode = node;
m_eventTargetNode = eventTarget;
m_omitTooltip = omitTooltip;
+ const ComputedStyle* style = m_highlightNode->computedStyle();
+ if (style)
+ m_initValue = style->marginLeft().intValue();
update();
}
@@ -461,6 +467,14 @@ void InspectorOverlayImpl::overlaySteppedOver()
m_listener->overlaySteppedOver();
}
+void InspectorOverlayImpl::updateCSSProperty(long newValue)
+{
+
+ if (!m_cssListener || !m_highlightNode)
+ return;
+ m_cssListener->updateCSSProperty(m_highlightNode.get(), m_initValue + newValue);
+}
+
void InspectorOverlayImpl::suspendUpdates()
{
if (!m_suspendCount++)
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | Source/web/WebDevToolsAgentImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698