Commit 5b8ac5fb authored by sczs's avatar sczs Committed by Commit Bot

[ios] Creates flag to enable Messages only for iOS13

Change-Id: I695b93df9fc6a723f76065891935e979ba48796d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151970Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760085}
parent 83dbf361
......@@ -2656,6 +2656,11 @@
"owners": [ "sczs", "thegreenfrog" ],
"expiry_milestone": 83
},
{
"name": "infobar-ui-reboot-only-ios13",
"owners": [ "sczs", "thegreenfrog" ],
"expiry_milestone": 84
},
{
"name": "installable-ink-drop",
"owners": [ "collinbaker", "pbos" ],
......
......@@ -601,6 +601,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableAutofillCacheServerCardInfoDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheServerCardInfo)},
{"infobar-ui-reboot-only-ios13",
flag_descriptions::kInfobarUIRebootOnlyiOS13Name,
flag_descriptions::kInfobarUIRebootOnlyiOS13Description, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kInfobarUIRebootOnlyiOS13)},
};
// Add all switches from experimental flags to |command_line|.
......
......@@ -266,6 +266,10 @@ const char kInfobarUIRebootName[] = "Infobar UI Reboot";
const char kInfobarUIRebootDescription[] =
"When enabled, Infobar will use the new UI.";
const char kInfobarUIRebootOnlyiOS13Name[] = "Infobar UI Reboot iOS13";
const char kInfobarUIRebootOnlyiOS13Description[] =
"When enabled, Infobar will use the new UI only on iOS13";
const char kInProductHelpDemoModeName[] = "In-Product Help Demo Mode";
const char kInProductHelpDemoModeDescription[] =
"When enabled, in-product help promotions occur exactly once per cold "
......
......@@ -226,6 +226,11 @@ extern const char kInfobarOverlayUIDescription[];
extern const char kInfobarUIRebootName[];
extern const char kInfobarUIRebootDescription[];
// Title and description for the flag to enable the new UI Reboot on Infobars
// only on iOS13.
extern const char kInfobarUIRebootOnlyiOS13Name[];
extern const char kInfobarUIRebootOnlyiOS13Description[];
// Title and description for the flag to enable feature_engagement::Tracker
// demo mode.
extern const char kInProductHelpDemoModeName[];
......
......@@ -44,6 +44,11 @@ extern const base::Feature kSaveCardInfobarMessagesUI;
// Use IsTranslateInfobarMessagesUIEnabled() instead of this constant directly.
extern const base::Feature kTranslateInfobarMessagesUI;
// Feature to choose whether to use the new Messages Infobar design on iOS13, or
// the legacy one.
// Use IsInfobarUIRebootEnabled() instead of this constant directly.
extern const base::Feature kInfobarUIRebootOnlyiOS13;
// Whether the Messages Infobar UI is enabled. Prefer to use this method instead
// of kIOSInfobarUIReboot directly.
bool IsInfobarUIRebootEnabled();
......
......@@ -37,12 +37,22 @@ const base::Feature kSaveCardInfobarMessagesUI{
// Feature enabled by default since it will always be guarded with
// |kIOSInfobarUIReboot|, meaning that if necessary,
// |kTranslateInfobarMessagesUI| can be used as a kill switch.
// TODO(crbug.com/1014959): Enabled flag once feature is ready.
const base::Feature kTranslateInfobarMessagesUI{
"TranslateInfobarMessagesUI", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kInfobarUIRebootOnlyiOS13{
"InfobarUIRebootOnlyiOS13", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsInfobarUIRebootEnabled() {
return base::FeatureList::IsEnabled(kIOSInfobarUIReboot);
if (base::FeatureList::IsEnabled(kInfobarUIRebootOnlyiOS13)) {
if (@available(iOS 13, *)) {
return base::FeatureList::IsEnabled(kIOSInfobarUIReboot);
} else {
return NO;
}
} else {
return base::FeatureList::IsEnabled(kIOSInfobarUIReboot);
}
}
bool IsInfobarOverlayUIEnabled() {
......
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