Commit 03d8c160 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Update shouldUseViewContentInset for smooth scrolling experiment.

This CL updates CRWWebViewProxy.shouldUseViewContentInset to be accurate
for the smooth scrolling experiment.

Bug: none
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I19036cc253ed52f99de5fc51949f96f8feabcd4c
Reviewed-on: https://chromium-review.googlesource.com/1176965Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586325}
parent 3f6687dc
......@@ -22,6 +22,8 @@
#error "This file requires ARC support."
#endif
using fullscreen::features::ViewportAdjustmentExperiment;
namespace {
// Returns whether fullscreen should be disabled for |web_state|'s SSL status.
// This will return true if the visible NavigationItem's SSL has a broken
......@@ -93,9 +95,11 @@ void FullscreenWebStateObserver::DidFinishNavigation(
// - For normal pages, using |contentInset| breaks the layout of fixed-
// position DOM elements, so top padding must be accomplished by updating
// the WKWebView's frame.
ViewportAdjustmentExperiment viewport_experiment =
fullscreen::features::GetActiveViewportExperiment();
bool force_content_inset =
fullscreen::features::GetActiveViewportExperiment() ==
fullscreen::features::ViewportAdjustmentExperiment::CONTENT_INSET;
viewport_experiment == ViewportAdjustmentExperiment::CONTENT_INSET ||
viewport_experiment == ViewportAdjustmentExperiment::SMOOTH_SCROLLING;
web_state->GetWebViewProxy().shouldUseViewContentInset =
force_content_inset ||
web_state->GetContentsMimeType() == "application/pdf";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment