OLD | NEW |
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 , m_overlayHost(InspectorOverlayHost::create()) | 140 , m_overlayHost(InspectorOverlayHost::create()) |
141 , m_drawViewSize(false) | 141 , m_drawViewSize(false) |
142 , m_drawViewSizeWithGrid(false) | 142 , m_drawViewSizeWithGrid(false) |
143 , m_resizeTimerActive(false) | 143 , m_resizeTimerActive(false) |
144 , m_omitTooltip(false) | 144 , m_omitTooltip(false) |
145 , m_timer(this, &InspectorOverlayImpl::onTimer) | 145 , m_timer(this, &InspectorOverlayImpl::onTimer) |
146 , m_suspendCount(0) | 146 , m_suspendCount(0) |
147 , m_inLayout(false) | 147 , m_inLayout(false) |
148 , m_needsUpdate(false) | 148 , m_needsUpdate(false) |
149 { | 149 { |
150 m_overlayHost->setDebuggerListener(this); | |
151 } | 150 } |
152 | 151 |
153 InspectorOverlayImpl::~InspectorOverlayImpl() | 152 InspectorOverlayImpl::~InspectorOverlayImpl() |
154 { | 153 { |
155 ASSERT(!m_overlayPage); | 154 ASSERT(!m_overlayPage); |
156 } | 155 } |
157 | 156 |
158 DEFINE_TRACE(InspectorOverlayImpl) | 157 DEFINE_TRACE(InspectorOverlayImpl) |
159 { | 158 { |
160 visitor->trace(m_highlightNode); | 159 visitor->trace(m_highlightNode); |
161 visitor->trace(m_eventTargetNode); | 160 visitor->trace(m_eventTargetNode); |
162 visitor->trace(m_overlayPage); | 161 visitor->trace(m_overlayPage); |
163 visitor->trace(m_overlayChromeClient); | 162 visitor->trace(m_overlayChromeClient); |
164 visitor->trace(m_overlayHost); | 163 visitor->trace(m_overlayHost); |
165 visitor->trace(m_layoutEditor); | 164 visitor->trace(m_layoutEditor); |
166 } | 165 } |
167 | 166 |
168 void InspectorOverlayImpl::init(InspectorCSSAgent* cssAgent, InspectorDebuggerAg
ent* debuggerAgent) | 167 void InspectorOverlayImpl::init(InspectorCSSAgent* cssAgent, InspectorDebuggerAg
ent* debuggerAgent) |
169 { | 168 { |
170 m_layoutEditor = LayoutEditor::create(cssAgent); | 169 m_layoutEditor = LayoutEditor::create(cssAgent); |
171 // TODO(dgozman): overlay should be a listener, not layout editor. | |
172 m_overlayHost->setLayoutEditorListener(m_layoutEditor.get()); | |
173 m_debuggerAgent = debuggerAgent; | 170 m_debuggerAgent = debuggerAgent; |
| 171 m_overlayHost->setListener(this); |
174 } | 172 } |
175 | 173 |
176 void InspectorOverlayImpl::invalidate() | 174 void InspectorOverlayImpl::invalidate() |
177 { | 175 { |
178 if (!m_pageOverlay) | 176 if (!m_pageOverlay) |
179 m_pageOverlay = PageOverlay::create(m_webViewImpl, new InspectorPageOver
layDelegate(*this)); | 177 m_pageOverlay = PageOverlay::create(m_webViewImpl, new InspectorPageOver
layDelegate(*this)); |
180 | 178 |
181 m_pageOverlay->update(); | 179 m_pageOverlay->update(); |
182 } | 180 } |
183 | 181 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 480 } |
483 | 481 |
484 void InspectorOverlayImpl::overlaySteppedOver() | 482 void InspectorOverlayImpl::overlaySteppedOver() |
485 { | 483 { |
486 if (m_debuggerAgent) { | 484 if (m_debuggerAgent) { |
487 ErrorString error; | 485 ErrorString error; |
488 m_debuggerAgent->stepOver(&error); | 486 m_debuggerAgent->stepOver(&error); |
489 } | 487 } |
490 } | 488 } |
491 | 489 |
| 490 void InspectorOverlayImpl::overlayStartedPropertyChange(const String& property) |
| 491 { |
| 492 m_layoutEditor->overlayStartedPropertyChange(property); |
| 493 } |
| 494 |
| 495 void InspectorOverlayImpl::overlayPropertyChanged(float value) |
| 496 { |
| 497 m_layoutEditor->overlayPropertyChanged(value); |
| 498 } |
| 499 |
| 500 void InspectorOverlayImpl::overlayEndedPropertyChange() |
| 501 { |
| 502 m_layoutEditor->overlayEndedPropertyChange(); |
| 503 } |
| 504 |
492 void InspectorOverlayImpl::profilingStarted() | 505 void InspectorOverlayImpl::profilingStarted() |
493 { | 506 { |
494 if (!m_suspendCount++) | 507 if (!m_suspendCount++) |
495 clear(); | 508 clear(); |
496 } | 509 } |
497 | 510 |
498 void InspectorOverlayImpl::profilingStopped() | 511 void InspectorOverlayImpl::profilingStopped() |
499 { | 512 { |
500 --m_suspendCount; | 513 --m_suspendCount; |
501 } | 514 } |
502 | 515 |
503 void InspectorOverlayImpl::pageLayoutInvalidated(bool resized) | 516 void InspectorOverlayImpl::pageLayoutInvalidated(bool resized) |
504 { | 517 { |
505 if (resized && m_drawViewSize) { | 518 if (resized && m_drawViewSize) { |
506 m_resizeTimerActive = true; | 519 m_resizeTimerActive = true; |
507 m_timer.startOneShot(1, FROM_HERE); | 520 m_timer.startOneShot(1, FROM_HERE); |
508 } | 521 } |
509 update(); | 522 update(); |
510 } | 523 } |
511 | 524 |
512 void InspectorOverlayImpl::setShowViewportSizeOnResize(bool show, bool showGrid) | 525 void InspectorOverlayImpl::setShowViewportSizeOnResize(bool show, bool showGrid) |
513 { | 526 { |
514 m_drawViewSize = show; | 527 m_drawViewSize = show; |
515 m_drawViewSizeWithGrid = showGrid; | 528 m_drawViewSizeWithGrid = showGrid; |
516 } | 529 } |
517 | 530 |
518 } // namespace blink | 531 } // namespace blink |
OLD | NEW |