Commit 2c9eae2c authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Add smooth scrolling fullscreen viewport adjustment choice.

Bug: none
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I088c5e5cbd24998539aef88eea1a034cb3604891
Reviewed-on: https://chromium-review.googlesource.com/1173714Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582803}
parent ed92bb3a
......@@ -17,7 +17,7 @@ extern const char kViewportAdjustmentExperimentCommandLineSwitch[];
// The available viewport adjustment experiments. The choices in this array
// correspond with the ViewportAdjustmentExperiment values.
extern const flags_ui::FeatureEntry::Choice
kViewportAdjustmentExperimentChoices[4];
kViewportAdjustmentExperimentChoices[5];
// Enum type describing viewport adjustment experiments.
enum class ViewportAdjustmentExperiment : short {
......@@ -28,6 +28,8 @@ enum class ViewportAdjustmentExperiment : short {
// container view.
HYBRID, // Translates the web view up and down and updates the viewport using
// safe area insets.
SMOOTH_SCROLLING, // Adjusts the viewport using the smooth scrolling
// workaround.
};
// Convenience method for retrieving the active viewport adjustment experiment
......
......@@ -16,6 +16,7 @@ namespace {
const char kContentInsetChoiceValue[] = "content-inset";
const char kSafeAreaChoiceValue[] = "safe-area";
const char kHybridChoiceValue[] = "hybrid";
const char kSmoothScrollingChoiceValue[] = "smooth";
}
namespace fullscreen {
......@@ -32,7 +33,8 @@ const flags_ui::FeatureEntry::Choice kViewportAdjustmentExperimentChoices[] = {
"safe-area"},
{"Use Hybrid Implementation",
kViewportAdjustmentExperimentCommandLineSwitch, "hybrid"},
};
{"Use Smooth Scrolling Workaround",
kViewportAdjustmentExperimentCommandLineSwitch, "smooth"}};
ViewportAdjustmentExperiment GetActiveViewportExperiment() {
const base::CommandLine* command_line =
......@@ -46,6 +48,8 @@ ViewportAdjustmentExperiment GetActiveViewportExperiment() {
return ViewportAdjustmentExperiment::SAFE_AREA;
if (viewport_experiment == std::string(kHybridChoiceValue))
return ViewportAdjustmentExperiment::HYBRID;
if (viewport_experiment == std::string(kSmoothScrollingChoiceValue))
return ViewportAdjustmentExperiment::SMOOTH_SCROLLING;
}
return ViewportAdjustmentExperiment::FRAME;
}
......
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