Commit 004fa6cc authored by sczs's avatar sczs Committed by Commit Bot

[ios] Creates Feature Flag for Save Card Messages.

Bug: 1014652
Change-Id: Ic902b03346ba9eb96fd77e0f449dfd951036bae2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1866980
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707417}
parent 31c67645
...@@ -560,6 +560,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -560,6 +560,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kDisableAnimationOnLowBatteryName, flag_descriptions::kDisableAnimationOnLowBatteryName,
flag_descriptions::kDisableAnimationOnLowBatteryDescription, flag_descriptions::kDisableAnimationOnLowBatteryDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableAnimationOnLowBattery)}, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDisableAnimationOnLowBattery)},
{"messages-save-card-infobar",
flag_descriptions::kSaveCardInfobarMessagesUIName,
flag_descriptions::kSaveCardInfobarMessagesUIDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kSaveCardInfobarMessagesUI)},
}; };
// Add all switches from experimental flags to |command_line|. // Add all switches from experimental flags to |command_line|.
......
...@@ -292,6 +292,10 @@ const char kPasswordLeakDetectionName[] = "Password Leak Detection"; ...@@ -292,6 +292,10 @@ const char kPasswordLeakDetectionName[] = "Password Leak Detection";
const char kPasswordLeakDetectionDescription[] = const char kPasswordLeakDetectionDescription[] =
"Enables the detection of leaked passwords."; "Enables the detection of leaked passwords.";
const char kSaveCardInfobarMessagesUIName[] = "Save Card Infobar Messages UI";
const char kSaveCardInfobarMessagesUIDescription[] =
"When enabled, Save Card Infobar uses the new Messages UI.";
const char kSearchIconToggleName[] = "Change the icon for the search button"; const char kSearchIconToggleName[] = "Change the icon for the search button";
const char kSearchIconToggleDescription[] = const char kSearchIconToggleDescription[] =
"Different icons for the search button."; "Different icons for the search button.";
......
...@@ -249,6 +249,11 @@ extern const char kOptionalArticleThumbnailDescription[]; ...@@ -249,6 +249,11 @@ extern const char kOptionalArticleThumbnailDescription[];
extern const char kPasswordLeakDetectionName[]; extern const char kPasswordLeakDetectionName[];
extern const char kPasswordLeakDetectionDescription[]; extern const char kPasswordLeakDetectionDescription[];
// Title and description for the flag that enables Messages UI on
// SaveCard Infobars.
extern const char kSaveCardInfobarMessagesUIName[];
extern const char kSaveCardInfobarMessagesUIDescription[];
// Title and description for the flag to toggle the flag of the search button. // Title and description for the flag to toggle the flag of the search button.
extern const char kSearchIconToggleName[]; extern const char kSearchIconToggleName[];
extern const char kSearchIconToggleDescription[]; extern const char kSearchIconToggleDescription[];
......
...@@ -13,15 +13,24 @@ ...@@ -13,15 +13,24 @@
extern const base::Feature kInfobarUIReboot; extern const base::Feature kInfobarUIReboot;
// Feature to choose whether Confirm Infobars use the new Messages UI or the // Feature to choose whether Confirm Infobars use the new Messages UI or the
// legacy one. In order for it to work kInfobarUIReboot also needs to be // legacy one. Also, in order for it to work kInfobarUIReboot needs to be
// enabled. // enabled.
// Use IsConfirmInfobarMessagesUIEnabled() instead of this constant directly. // Use IsConfirmInfobarMessagesUIEnabled() instead of this constant directly.
extern const base::Feature kConfirmInfobarMessagesUI; extern const base::Feature kConfirmInfobarMessagesUI;
// Feature to choose whether Save Card Infobar uses the new Messages UI or the
// legacy one. Also, in order for it to work kInfobarUIReboot needs to be
// enabled.
// Use IsSaveCardInfobarMessagesUIEnabled() instead of this constant directly.
extern const base::Feature kSaveCardInfobarMessagesUI;
// Whether the Messages Infobar UI is enabled. // Whether the Messages Infobar UI is enabled.
bool IsInfobarUIRebootEnabled(); bool IsInfobarUIRebootEnabled();
// Whether the Confirm Infobar Messages UI is enabled. // Whether the Confirm Infobar Messages UI is enabled.
bool IsConfirmInfobarMessagesUIEnabled(); bool IsConfirmInfobarMessagesUIEnabled();
// Whether the SaveCard Infobar Messages UI is enabled.
bool IsSaveCardInfobarMessagesUIEnabled();
#endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_FEATURE_H_ #endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_FEATURE_H_
...@@ -17,6 +17,13 @@ const base::Feature kInfobarUIReboot{"InfobarUIReboot", ...@@ -17,6 +17,13 @@ const base::Feature kInfobarUIReboot{"InfobarUIReboot",
const base::Feature kConfirmInfobarMessagesUI{"ConfirmInfobarMessagesUI", const base::Feature kConfirmInfobarMessagesUI{"ConfirmInfobarMessagesUI",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_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.
// TODO(crbug.com/1014652): Enable by Default once feature should be tested.
const base::Feature kSaveCardInfobarMessagesUI{
"SaveCardInfobarMessagesUI", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsInfobarUIRebootEnabled() { bool IsInfobarUIRebootEnabled() {
return base::FeatureList::IsEnabled(kInfobarUIReboot); return base::FeatureList::IsEnabled(kInfobarUIReboot);
} }
...@@ -25,3 +32,8 @@ bool IsConfirmInfobarMessagesUIEnabled() { ...@@ -25,3 +32,8 @@ bool IsConfirmInfobarMessagesUIEnabled() {
return base::FeatureList::IsEnabled(kConfirmInfobarMessagesUI) && return base::FeatureList::IsEnabled(kConfirmInfobarMessagesUI) &&
IsInfobarUIRebootEnabled(); IsInfobarUIRebootEnabled();
} }
bool IsSaveCardInfobarMessagesUIEnabled() {
return base::FeatureList::IsEnabled(kSaveCardInfobarMessagesUI) &&
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