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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1398823004: Switch the page-capturing machinery to use the new hooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 375c92e1a1f33f04c7923433bb9591cbf13185b1..c760a81f73fe1a734e7fc5822a9c6502269d0cdd 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -138,6 +138,7 @@
#include "public/web/WebGraphicsContext.h"
#include "public/web/WebHitTestResult.h"
#include "public/web/WebInputElement.h"
+#include "public/web/WebMeaningfulLayout.h"
#include "public/web/WebMediaPlayerAction.h"
#include "public/web/WebNode.h"
#include "public/web/WebPlugin.h"
@@ -446,6 +447,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_userGestureObserved(false)
, m_shouldDispatchFirstVisuallyNonEmptyLayout(false)
, m_shouldDispatchFirstLayoutAfterFinishedParsing(false)
+ , m_shouldDispatchFirstLayoutAfterFinishedLoading(false)
, m_displayMode(WebDisplayModeBrowser)
, m_elasticOverscroll(FloatSize())
{
@@ -1909,12 +1911,17 @@ void WebViewImpl::layout()
m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
// TODO(esprehn): Move users of this callback to something
// better, the heuristic for "visually non-empty" is bad.
- client()->didFirstVisuallyNonEmptyLayout();
+ client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty);
}
if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document()->hasFinishedParsing()) {
m_shouldDispatchFirstLayoutAfterFinishedParsing = false;
- client()->didFirstLayoutAfterFinishedParsing();
+ client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing);
+ }
+
+ if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document()->isLoadCompleted()) {
+ m_shouldDispatchFirstLayoutAfterFinishedLoading = false;
+ client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading);
}
}
}
@@ -4124,6 +4131,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
m_layerTreeView->clearRootLayer();
m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
+ m_shouldDispatchFirstLayoutAfterFinishedLoading = true;
visualViewport.clearLayersForTreeView(m_layerTreeView);
}
}

Powered by Google App Engine
This is Rietveld 408576698