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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1316033003: [DevTools] Make WebDevToolsAgentImpl own InspectorOverlayImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 4228b9422e46d6bc963174afd94e3f0adc782f8f..f18d8d58f8df9360ae046429b787f7dc1a361af8 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -501,11 +501,11 @@ WebDevToolsAgentImpl* WebViewImpl::mainFrameDevToolsAgentImpl()
return mainFrame ? mainFrame->devToolsAgentImpl() : nullptr;
}
-InspectorOverlay* WebViewImpl::inspectorOverlay()
+InspectorOverlayImpl* WebViewImpl::inspectorOverlay()
{
- if (!m_inspectorOverlay)
- m_inspectorOverlay = InspectorOverlayImpl::create(this);
- return m_inspectorOverlay.get();
+ if (WebDevToolsAgentImpl* devtools = mainFrameDevToolsAgentImpl())
+ return static_cast<InspectorOverlayImpl*>(devtools->overlay());
+ return nullptr;
}
WebLocalFrameImpl* WebViewImpl::mainFrameImpl()
@@ -1894,8 +1894,8 @@ void WebViewImpl::layout()
PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame());
updateLayerTreeBackgroundColor();
- if (m_inspectorOverlay)
- m_inspectorOverlay->layout();
+ if (InspectorOverlayImpl* overlay = inspectorOverlay())
+ overlay->layout();
for (size_t i = 0; i < m_linkHighlights.size(); ++i)
m_linkHighlights[i]->updateGeometry();
@@ -2087,8 +2087,10 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
if (devTools && devTools->handleInputEvent(inputEvent))
return true;
- if (m_inspectorOverlay && m_inspectorOverlay->handleInputEvent(inputEvent))
- return true;
+ if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
+ if (overlay->handleInputEvent(inputEvent))
+ return true;
+ }
// Report the event to be NOT processed by WebKit, so that the browser can handle it appropriately.
if (m_ignoreInputEvents)
@@ -3968,8 +3970,8 @@ void WebViewImpl::pageScaleFactorChanged()
{
pageScaleConstraintsSet().setNeedsReset(false);
updateLayerTreeViewport();
- if (m_inspectorOverlay)
- m_inspectorOverlay->update();
+ if (InspectorOverlayImpl* overlay = inspectorOverlay())
+ overlay->update();
m_devToolsEmulator->viewportChanged();
m_client->pageScaleFactorChanged();
}
@@ -4430,8 +4432,8 @@ void WebViewImpl::updatePageOverlays()
{
if (m_pageColorOverlay)
m_pageColorOverlay->update();
- if (m_inspectorOverlay) {
- PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
+ if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
+ PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
if (inspectorPageOverlay)
inspectorPageOverlay->update();
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698