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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month 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/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 031199d6675b7907a7f77c7e2eb8dc81a63a6c7d..94171f98337b9a81e85dd022734205ae39f45f0f 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1323,13 +1323,18 @@ void FrameLoader::commitProvisionalLoad() {
return;
if (isLoadingMainFrame()) {
+ // TODO(wjmaclean): Instead of passing |m_frame| here we pass nullptr
+ // instead so the properties will be set on the WebView. We do this since,
+ // while we are loading, the WebFrameWidget for m_frame may not yet
+ // be available.
m_frame->page()->chromeClient().setEventListenerProperties(
- WebEventListenerClass::TouchStartOrMove,
+ nullptr, WebEventListenerClass::TouchStartOrMove,
WebEventListenerProperties::Nothing);
m_frame->page()->chromeClient().setEventListenerProperties(
- WebEventListenerClass::MouseWheel, WebEventListenerProperties::Nothing);
+ nullptr, WebEventListenerClass::MouseWheel,
+ WebEventListenerProperties::Nothing);
m_frame->page()->chromeClient().setEventListenerProperties(
- WebEventListenerClass::TouchEndOrCancel,
+ nullptr, WebEventListenerClass::TouchEndOrCancel,
WebEventListenerProperties::Nothing);
}
@@ -1410,6 +1415,7 @@ void FrameLoader::restoreScrollPositionAndViewState() {
}
VisualViewport& visualViewport = m_frame->host()->visualViewport();
+ float originalScale = visualViewport.scale();
if (shouldRestoreScale && shouldRestoreScroll) {
visualViewport.setScaleAndLocation(m_currentItem->pageScaleFactor(),
FloatPoint(visualViewportOffset));
@@ -1418,6 +1424,9 @@ void FrameLoader::restoreScrollPositionAndViewState() {
} else if (shouldRestoreScroll) {
visualViewport.setLocation(FloatPoint(visualViewportOffset));
}
+ // If necessary, notify client we've restored page scale.
+ if (shouldRestoreScale && (originalScale != visualViewport.scale()))
+ client()->didRestorePageScaleFactorOnLoad(visualViewport.scale());
if (ScrollingCoordinator* scrollingCoordinator =
m_frame->page()->scrollingCoordinator())
« no previous file with comments | « third_party/WebKit/Source/core/loader/EmptyClients.h ('k') | third_party/WebKit/Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698