Commit f7c9b075 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Add Browser-scoped FullscreenController flag

This flag will be used to build out support for scoping FullscreenController
to a Browser while keeping the current BrowserState-scoped logic as default.

Bug: 790886
Change-Id: Iac1811181a6313271561ffecae306fe4b7b94684
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007314
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734534}
parent f663b438
......@@ -601,6 +601,12 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kChangeTabSwitcherPositionName,
flag_descriptions::kChangeTabSwitcherPositionDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kChangeTabSwitcherPosition)},
{"fullscreen-controller-browser-scoped",
flag_descriptions::kFullscreenControllerBrowserScopedName,
flag_descriptions::kFullscreenControllerBrowserScopedDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(
fullscreen::features::kFullscreenControllerBrowserScoped)},
};
// Add all switches from experimental flags to |command_line|.
......
......@@ -245,6 +245,12 @@ const char kFullscreenSmoothScrollingDescription[] =
"When enabled, the web view's insets are updated for scoll events. If "
"disabled, the the web view's frame are updated.";
const char kFullscreenControllerBrowserScopedName[] =
"Scope FullscreenController to Browser";
const char kFullscreenControllerBrowserScopedDescription[] =
"When enabled, FullscreenController will be stored and retrieved using the "
"Browser.";
const char kIgnoresViewportScaleLimitsName[] = "Ignore Viewport Scale Limits";
const char kIgnoresViewportScaleLimitsDescription[] =
"When enabled the page can always be scaled, regardless of author intent.";
......
......@@ -209,6 +209,11 @@ extern const char kForceUnstackedTabstripDescription[];
extern const char kFullscreenSmoothScrollingName[];
extern const char kFullscreenSmoothScrollingDescription[];
// Title and description for the flag to scope FullscreenController to a
// Browser.
extern const char kFullscreenControllerBrowserScopedName[];
extern const char kFullscreenControllerBrowserScopedDescription[];
// Title and description for the flag to ignore viewport scale limits.
extern const char kIgnoresViewportScaleLimitsName[];
extern const char kIgnoresViewportScaleLimitsDescription[];
......
......@@ -15,10 +15,17 @@ namespace features {
// viewport adjustment experiment is selected via command line switches.
extern const base::Feature kSmoothScrollingDefault;
// Feature used to enable scoping FullscreenController to a Browser.
extern const base::Feature kFullscreenControllerBrowserScoped;
// Convenience method for determining when to adjust the viewport by resizing
// WKWebView or using smooth scrolling.
bool ShouldUseSmoothScrolling();
// Convenience method for determining when FullscreenController is stored and
// retrieved using the Browser instead of the BrowserState.
bool ShouldScopeFullscreenControllerToBrowser();
} // namespace features
} // namespace fullscreen
......
......@@ -17,9 +17,16 @@ namespace features {
const base::Feature kSmoothScrollingDefault{"FullscreenSmoothScrollingDefault",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kFullscreenControllerBrowserScoped{
"FullscreenControllerBrowserScoped", base::FEATURE_DISABLED_BY_DEFAULT};
bool ShouldUseSmoothScrolling() {
return base::FeatureList::IsEnabled(kSmoothScrollingDefault);
}
bool ShouldScopeFullscreenControllerToBrowser() {
return base::FeatureList::IsEnabled(kFullscreenControllerBrowserScoped);
}
} // namespace features
} // namespace fullscreen
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