Commit b20f9681 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Clean up toolbar search icon

This CL cleans up the toolbar search icon as the experiment is launched.

Fixed: 1050994
Change-Id: I537f449d817ccc416a1477487292b27bc0de454b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050268Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740589}
parent 1f101f51
...@@ -221,24 +221,6 @@ const FeatureEntry::FeatureVariation ...@@ -221,24 +221,6 @@ const FeatureEntry::FeatureVariation
{"12 matches", kOmniboxUIMaxAutocompleteMatches12, {"12 matches", kOmniboxUIMaxAutocompleteMatches12,
base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}}; base::size(kOmniboxUIMaxAutocompleteMatches12), nullptr}};
const FeatureEntry::FeatureParam kIconForSearchButtonGrey[] = {
{kIconForSearchButtonFeatureParameterName,
kIconForSearchButtonParameterGrey}};
const FeatureEntry::FeatureParam kIconForSearchButtonColorful[] = {
{kIconForSearchButtonFeatureParameterName,
kIconForSearchButtonParameterColorful}};
const FeatureEntry::FeatureParam kIconForSearchButtonMagnifying[] = {
{kIconForSearchButtonFeatureParameterName,
kIconForSearchButtonParameterMagnifying}};
const FeatureEntry::FeatureVariation kIconForSearchButtonVariations[] = {
{"Grey search engine logo", kIconForSearchButtonGrey,
base::size(kIconForSearchButtonGrey), nullptr},
{"Colorful search engine logo", kIconForSearchButtonColorful,
base::size(kIconForSearchButtonColorful), nullptr},
{"Magnifying glass", kIconForSearchButtonMagnifying,
base::size(kIconForSearchButtonMagnifying), nullptr}};
const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout3s[] = { const FeatureEntry::FeatureParam kDetectMainThreadFreezeTimeout3s[] = {
{crash_report::kDetectMainThreadFreezeParameterName, {crash_report::kDetectMainThreadFreezeParameterName,
crash_report::kDetectMainThreadFreezeParameter3s}}; crash_report::kDetectMainThreadFreezeParameter3s}};
...@@ -432,11 +414,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -432,11 +414,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
omnibox::kUIExperimentMaxAutocompleteMatches, omnibox::kUIExperimentMaxAutocompleteMatches,
kOmniboxUIMaxAutocompleteMatchesVariations, kOmniboxUIMaxAutocompleteMatchesVariations,
"OmniboxUIMaxAutocompleteVariations")}, "OmniboxUIMaxAutocompleteVariations")},
{"search-icon-toggle", flag_descriptions::kSearchIconToggleName,
flag_descriptions::kSearchIconToggleDescription, flags_ui::kOsIos,
FEATURE_WITH_PARAMS_VALUE_TYPE(kIconForSearchButtonFeature,
kIconForSearchButtonVariations,
"ToggleSearchButtonIcon")},
{"enable-breakpad-upload-no-delay", {"enable-breakpad-upload-no-delay",
flag_descriptions::kBreakpadNoDelayInitialUploadName, flag_descriptions::kBreakpadNoDelayInitialUploadName,
flag_descriptions::kBreakpadNoDelayInitialUploadDescription, flag_descriptions::kBreakpadNoDelayInitialUploadDescription,
......
...@@ -328,10 +328,6 @@ const char kSaveCardInfobarMessagesUIName[] = "Save Card Infobar Messages UI"; ...@@ -328,10 +328,6 @@ const char kSaveCardInfobarMessagesUIName[] = "Save Card Infobar Messages UI";
const char kSaveCardInfobarMessagesUIDescription[] = const char kSaveCardInfobarMessagesUIDescription[] =
"When enabled, Save Card Infobar uses the new Messages UI."; "When enabled, Save Card Infobar uses the new Messages UI.";
const char kSearchIconToggleName[] = "Change the icon for the search button";
const char kSearchIconToggleDescription[] =
"Different icons for the search button.";
const char kSendTabToSelfName[] = "Send tab to self"; const char kSendTabToSelfName[] = "Send tab to self";
const char kSendTabToSelfDescription[] = const char kSendTabToSelfDescription[] =
"Allows users to receive tabs that were pushed from another of their " "Allows users to receive tabs that were pushed from another of their "
......
...@@ -284,10 +284,6 @@ extern const char kReloadSadTabDescription[]; ...@@ -284,10 +284,6 @@ extern const char kReloadSadTabDescription[];
extern const char kSaveCardInfobarMessagesUIName[]; extern const char kSaveCardInfobarMessagesUIName[];
extern const char kSaveCardInfobarMessagesUIDescription[]; extern const char kSaveCardInfobarMessagesUIDescription[];
// Title and description for the flag to toggle the flag of the search button.
extern const char kSearchIconToggleName[];
extern const char kSearchIconToggleDescription[];
// Title and description for the flag to enable the send tab to self receiving // Title and description for the flag to enable the send tab to self receiving
// feature. // feature.
extern const char kSendTabToSelfName[]; extern const char kSendTabToSelfName[];
......
...@@ -14,25 +14,4 @@ extern const base::Feature kChangeTabSwitcherPosition; ...@@ -14,25 +14,4 @@ extern const base::Feature kChangeTabSwitcherPosition;
extern const base::Feature kToolbarNewTabButton; extern const base::Feature kToolbarNewTabButton;
// Enum for the different icons for the search button.
typedef NS_ENUM(NSUInteger, ToolbarSearchButtonIcon) {
ToolbarSearchButtonIconGrey,
ToolbarSearchButtonIconColorful,
ToolbarSearchButtonIconMagnifying,
};
// Feature for changing the different icons for search icon in the bottom
// toolbar.
extern const base::Feature kIconForSearchButtonFeature;
// Switch with the different values for the search icon on the bottom adaptive
// toolbar.
extern const char kIconForSearchButtonFeatureParameterName[];
extern const char kIconForSearchButtonParameterGrey[];
extern const char kIconForSearchButtonParameterColorful[];
extern const char kIconForSearchButtonParameterMagnifying[];
// Returns the currently selected icon option.
ToolbarSearchButtonIcon IconForSearchButton();
#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_FEATURES_H_ #endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_FEATURES_H_
...@@ -16,28 +16,3 @@ const base::Feature kChangeTabSwitcherPosition{ ...@@ -16,28 +16,3 @@ const base::Feature kChangeTabSwitcherPosition{
const base::Feature kToolbarNewTabButton{"ToolbarNewTabButton", const base::Feature kToolbarNewTabButton{"ToolbarNewTabButton",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIconForSearchButtonFeature{
"IconForSearchButtonFeature", base::FEATURE_ENABLED_BY_DEFAULT};
const char kIconForSearchButtonFeatureParameterName[] = "icon";
const char kIconForSearchButtonParameterGrey[] = "grey";
const char kIconForSearchButtonParameterColorful[] = "colorful";
const char kIconForSearchButtonParameterMagnifying[] = "magnifying";
ToolbarSearchButtonIcon IconForSearchButton() {
if (base::FeatureList::IsEnabled(kIconForSearchButtonFeature)) {
std::string parameter = base::GetFieldTrialParamValueByFeature(
kIconForSearchButtonFeature, kIconForSearchButtonFeatureParameterName);
if (parameter == kIconForSearchButtonParameterGrey) {
return ToolbarSearchButtonIconGrey;
} else if (parameter == kIconForSearchButtonParameterColorful) {
return ToolbarSearchButtonIconColorful;
} else if (parameter == kIconForSearchButtonParameterMagnifying) {
return ToolbarSearchButtonIconMagnifying;
}
return ToolbarSearchButtonIconColorful;
}
return ToolbarSearchButtonIconMagnifying;
}
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