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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | Source/web/WebDevToolsAgentImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 24 matching lines...) Expand all
35 #include "core/frame/FrameHost.h" 35 #include "core/frame/FrameHost.h"
36 #include "core/frame/FrameView.h" 36 #include "core/frame/FrameView.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
39 #include "core/inspector/InspectorOverlayHost.h" 39 #include "core/inspector/InspectorOverlayHost.h"
40 #include "core/loader/EmptyClients.h" 40 #include "core/loader/EmptyClients.h"
41 #include "core/loader/FrameLoadRequest.h" 41 #include "core/loader/FrameLoadRequest.h"
42 #include "core/page/ChromeClient.h" 42 #include "core/page/ChromeClient.h"
43 #include "core/page/EventHandler.h" 43 #include "core/page/EventHandler.h"
44 #include "core/page/Page.h" 44 #include "core/page/Page.h"
45 #include "core/style/ComputedStyle.h"
45 #include "platform/JSONValues.h" 46 #include "platform/JSONValues.h"
46 #include "platform/ScriptForbiddenScope.h" 47 #include "platform/ScriptForbiddenScope.h"
47 #include "platform/graphics/GraphicsContext.h" 48 #include "platform/graphics/GraphicsContext.h"
48 #include "public/platform/Platform.h" 49 #include "public/platform/Platform.h"
49 #include "public/platform/WebData.h" 50 #include "public/platform/WebData.h"
50 #include "web/WebGraphicsContextImpl.h" 51 #include "web/WebGraphicsContextImpl.h"
51 #include "web/WebInputEventConversion.h" 52 #include "web/WebInputEventConversion.h"
52 #include "web/WebLocalFrameImpl.h" 53 #include "web/WebLocalFrameImpl.h"
53 #include "web/WebViewImpl.h" 54 #include "web/WebViewImpl.h"
54 #include <v8.h> 55 #include <v8.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 // InspectorOverlay implementation. 100 // InspectorOverlay implementation.
100 void update() override { } 101 void update() override { }
101 void setPausedInDebuggerMessage(const String*) override { } 102 void setPausedInDebuggerMessage(const String*) override { }
102 void setInspectModeEnabled(bool) override { } 103 void setInspectModeEnabled(bool) override { }
103 void hideHighlight() override { } 104 void hideHighlight() override { }
104 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip) override { } 105 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip) override { }
105 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o verride { } 106 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o verride { }
106 void showAndHideViewSize(bool showGrid) override { } 107 void showAndHideViewSize(bool showGrid) override { }
107 void setListener(InspectorOverlay::Listener* listener) override { } 108 void setListener(InspectorOverlay::Listener* listener) override { }
109 void setCSSListener(InspectorOverlay::CSSListener* listener) override { }
108 void suspendUpdates() override { } 110 void suspendUpdates() override { }
109 void resumeUpdates() override { } 111 void resumeUpdates() override { }
110 void clear() override { } 112 void clear() override { }
111 }; 113 };
112 114
113 DEFINE_TRACE(InspectorOverlayStub) 115 DEFINE_TRACE(InspectorOverlayStub)
114 { 116 {
115 InspectorOverlay::trace(visitor); 117 InspectorOverlay::trace(visitor);
116 } 118 }
117 119
(...skipping 10 matching lines...) Expand all
128 , m_inspectModeEnabled(false) 130 , m_inspectModeEnabled(false)
129 , m_overlayHost(InspectorOverlayHost::create()) 131 , m_overlayHost(InspectorOverlayHost::create())
130 , m_drawViewSize(false) 132 , m_drawViewSize(false)
131 , m_drawViewSizeWithGrid(false) 133 , m_drawViewSizeWithGrid(false)
132 , m_omitTooltip(false) 134 , m_omitTooltip(false)
133 , m_timer(this, &InspectorOverlayImpl::onTimer) 135 , m_timer(this, &InspectorOverlayImpl::onTimer)
134 , m_suspendCount(0) 136 , m_suspendCount(0)
135 , m_updating(false) 137 , m_updating(false)
136 { 138 {
137 m_overlayHost->setListener(this); 139 m_overlayHost->setListener(this);
140 m_overlayHost->setCSSListener(this);
138 } 141 }
139 142
140 InspectorOverlayImpl::~InspectorOverlayImpl() 143 InspectorOverlayImpl::~InspectorOverlayImpl()
141 { 144 {
142 ASSERT(!m_overlayPage); 145 ASSERT(!m_overlayPage);
143 } 146 }
144 147
145 DEFINE_TRACE(InspectorOverlayImpl) 148 DEFINE_TRACE(InspectorOverlayImpl)
146 { 149 {
147 visitor->trace(m_highlightNode); 150 visitor->trace(m_highlightNode);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 m_highlightQuad.clear(); 228 m_highlightQuad.clear();
226 update(); 229 update();
227 } 230 }
228 231
229 void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const In spectorHighlightConfig& highlightConfig, bool omitTooltip) 232 void InspectorOverlayImpl::highlightNode(Node* node, Node* eventTarget, const In spectorHighlightConfig& highlightConfig, bool omitTooltip)
230 { 233 {
231 m_nodeHighlightConfig = highlightConfig; 234 m_nodeHighlightConfig = highlightConfig;
232 m_highlightNode = node; 235 m_highlightNode = node;
233 m_eventTargetNode = eventTarget; 236 m_eventTargetNode = eventTarget;
234 m_omitTooltip = omitTooltip; 237 m_omitTooltip = omitTooltip;
238 const ComputedStyle* style = m_highlightNode->computedStyle();
239 if (style)
240 m_initValue = style->marginLeft().intValue();
235 update(); 241 update();
236 } 242 }
237 243
238 void InspectorOverlayImpl::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspe ctorHighlightConfig& highlightConfig) 244 void InspectorOverlayImpl::highlightQuad(PassOwnPtr<FloatQuad> quad, const Inspe ctorHighlightConfig& highlightConfig)
239 { 245 {
240 m_quadHighlightConfig = highlightConfig; 246 m_quadHighlightConfig = highlightConfig;
241 m_highlightQuad = quad; 247 m_highlightQuad = quad;
242 m_omitTooltip = false; 248 m_omitTooltip = false;
243 update(); 249 update();
244 } 250 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (m_listener) 460 if (m_listener)
455 m_listener->overlayResumed(); 461 m_listener->overlayResumed();
456 } 462 }
457 463
458 void InspectorOverlayImpl::overlaySteppedOver() 464 void InspectorOverlayImpl::overlaySteppedOver()
459 { 465 {
460 if (m_listener) 466 if (m_listener)
461 m_listener->overlaySteppedOver(); 467 m_listener->overlaySteppedOver();
462 } 468 }
463 469
470 void InspectorOverlayImpl::updateCSSProperty(long newValue)
471 {
472
473 if (!m_cssListener || !m_highlightNode)
474 return;
475 m_cssListener->updateCSSProperty(m_highlightNode.get(), m_initValue + newVal ue);
476 }
477
464 void InspectorOverlayImpl::suspendUpdates() 478 void InspectorOverlayImpl::suspendUpdates()
465 { 479 {
466 if (!m_suspendCount++) 480 if (!m_suspendCount++)
467 clear(); 481 clear();
468 } 482 }
469 483
470 void InspectorOverlayImpl::resumeUpdates() 484 void InspectorOverlayImpl::resumeUpdates()
471 { 485 {
472 --m_suspendCount; 486 --m_suspendCount;
473 } 487 }
474 488
475 } // namespace blink 489 } // namespace blink
OLDNEW
« 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