Commit d754e8ec authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Create flag for OverlayPresenter-based InfoBar presentation.

Bug: 1030357
Change-Id: I04d43c5c4fd65d5050e7dd5b2162b2d82a7b7340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949109
Auto-Submit: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721143}
parent 040bf142
......@@ -589,6 +589,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kCrashRestoreInfobarMessagesUIName,
flag_descriptions::kCrashRestoreInfobarMessagesUIDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCrashRestoreInfobarMessagesUI)},
{"infobar-overlay-ui", flag_descriptions::kInfobarOverlayUIName,
flag_descriptions::kInfobarOverlayUIDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kInfobarOverlayUI)},
};
// Add all switches from experimental flags to |command_line|.
......
......@@ -226,6 +226,11 @@ const char kIgnoresViewportScaleLimitsName[] = "Ignore Viewport Scale Limits";
const char kIgnoresViewportScaleLimitsDescription[] =
"When enabled the page can always be scaled, regardless of author intent.";
const char kInfobarOverlayUIName[] = "Use OverlayPresenter for infobars";
const char kInfobarOverlayUIDescription[] =
"When enabled alongside the Infobar UI Reboot, infobars will be presented "
"using OverlayPresenter.";
const char kInfobarUIRebootName[] = "Infobar UI Reboot";
const char kInfobarUIRebootDescription[] =
"When enabled, Infobar will use the new UI.";
......
......@@ -194,6 +194,11 @@ extern const char kFullscreenSmoothScrollingDescription[];
extern const char kIgnoresViewportScaleLimitsName[];
extern const char kIgnoresViewportScaleLimitsDescription[];
// Title and description for the flag to present the new UI Reboot on Infobars
// using OverlayPresenter.
extern const char kInfobarOverlayUIName[];
extern const char kInfobarOverlayUIDescription[];
// Title and description for the flag to enable the new UI Reboot on Infobars.
extern const char kInfobarUIRebootName[];
extern const char kInfobarUIRebootDescription[];
......
......@@ -12,6 +12,12 @@
// Use IsInfobarUIRebootEnabled() instead of this constant directly.
extern const base::Feature kInfobarUIReboot;
// Feature to choose whether to use OverlayPresenter to show the new Messages
// Infobar design. In order for it to work, kInfobarUIReboot needs to also be
// enabled.
// Use IsInfobarOverlayUIEnabled() instead of this constant directly.
extern const base::Feature kInfobarOverlayUI;
// Feature to choose whether Confirm Infobars use the new Messages UI or the
// legacy one. Also, in order for it to work kInfobarUIReboot needs to be
// enabled.
......@@ -46,6 +52,9 @@ extern const base::Feature kTranslateInfobarMessagesUI;
// Whether the Messages Infobar UI is enabled.
bool IsInfobarUIRebootEnabled();
// Whether the Messages Infobar UI is presented using OverlayPresenter.
bool IsInfobarOverlayUIEnabled();
// Whether the Confirm Infobar Messages UI is enabled.
bool IsConfirmInfobarMessagesUIEnabled();
......
......@@ -11,6 +11,9 @@
const base::Feature kInfobarUIReboot{"InfobarUIReboot",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kInfobarOverlayUI{"InfobarOverlayUI",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature enabled by default since it will always be checked along
// kInfobarUIReboot, effectively working as a kill switch. Meaning that if
// kInfobarUIReboot is not enabled this feature won't work.
......@@ -44,6 +47,11 @@ bool IsInfobarUIRebootEnabled() {
return base::FeatureList::IsEnabled(kInfobarUIReboot);
}
bool IsInfobarOverlayUIEnabled() {
return IsInfobarUIRebootEnabled() &&
base::FeatureList::IsEnabled(kInfobarOverlayUI);
}
bool IsConfirmInfobarMessagesUIEnabled() {
return base::FeatureList::IsEnabled(kConfirmInfobarMessagesUI) &&
IsInfobarUIRebootEnabled();
......
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