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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1309883003: Add hooks for capturing meaningful text info, gently. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Oopsie fixed. 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
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index db8f9bff299ca730b6eb3b6ad6a1ad1299a71eb0..ec12fcb9ef8e0eadf3bdde9ba53be5d6895ec921 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -454,6 +454,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_zoomFactorOverride(0)
, m_userGestureObserved(false)
, m_shouldDispatchFirstVisuallyNonEmptyLayout(false)
+ , m_shouldDispatchFirstLayoutAfterFinishedParsing(false)
, m_displayMode(WebDisplayModeBrowser)
, m_elasticOverscroll(FloatSize())
{
@@ -1899,11 +1900,19 @@ void WebViewImpl::layout()
m_linkHighlights[i]->updateGeometry();
if (FrameView* view = mainFrameImpl()->frameView()) {
+ LocalFrame* frame = mainFrameImpl()->frame();
+
if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEmpty()) {
m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
// TODO(esprehn): Move users of this callback to something
// better, the heuristic for "visually non-empty" is bad.
- mainFrameImpl()->frame()->loader().client()->dispatchDidFirstVisuallyNonEmptyLayout();
+ // TODO(dglazkov): This should likely be a WebViewClient API.
+ frame->loader().client()->dispatchDidFirstVisuallyNonEmptyLayout();
+ }
+
+ if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document()->hasFinishedParsing()) {
+ m_shouldDispatchFirstLayoutAfterFinishedParsing = false;
+ client()->didFirstLayoutAfterFinishedParsing();
}
}
}
@@ -4099,6 +4108,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
m_layerTreeView->setDeferCommits(true);
m_layerTreeView->clearRootLayer();
m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
+ m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeView);
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebLocalFrame.h » ('j') | public/web/WebLocalFrame.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698