Skip to content

Commit

Permalink
[RSearches] Remove the flag RelatedSearchesInBar
Browse files Browse the repository at this point in the history
Related Searches is launched, so we do not need to use finch to control
RelatedSearchesInBar as true.

Bug: 1380445
Change-Id: If43a145b65fde2768c738cd4a3eb24f6267df8c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4200994
Reviewed-by: Donn Denman <donnd@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1098117}
  • Loading branch information
Gang Wu authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent 343eab0 commit 7229745
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 51 deletions.
Expand Up @@ -32,7 +32,6 @@
import org.chromium.chrome.browser.contextualsearch.ContextualSearchUma;
import org.chromium.chrome.browser.contextualsearch.ResolvedSearchTerm.CardTag;
import org.chromium.chrome.browser.flags.ActivityType;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.layouts.scene_layer.SceneOverlayLayer;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
Expand Down Expand Up @@ -693,11 +692,8 @@ public void onSearchTermResolved(String searchTerm, @Nullable String pronunciati
@CardTag int cardTagEnum, @Nullable List<String> relatedSearchesInBar) {
boolean hadInBarSuggestions = getRelatedSearchesInBarControl().hasReleatedSearchesToShow();
getRelatedSearchesInBarControl().setRelatedSearchesSuggestions(relatedSearchesInBar);
if (ChromeFeatureList.isEnabled(ChromeFeatureList.RELATED_SEARCHES_IN_BAR)) {
if (getRelatedSearchesInBarControl().hasReleatedSearchesToShow()
!= hadInBarSuggestions) {
getSearchBarControl().animateInBarRelatedSearches(!hadInBarSuggestions);
}
if (getRelatedSearchesInBarControl().hasReleatedSearchesToShow() != hadInBarSuggestions) {
getSearchBarControl().animateInBarRelatedSearches(!hadInBarSuggestions);
}

if (cardTagEnum == CardTag.CT_DEFINITION
Expand Down
Expand Up @@ -1843,10 +1843,6 @@ private int getBasePageHeight() {
* if the feature for showing chips is not enabled.
*/
private @Nullable List<String> buildRelatedSearches(String defaultSearch) {
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.RELATED_SEARCHES_IN_BAR)) {
return null;
}

List<String> queries = mRelatedSearches.getQueries();
if (queries.size() == 0) {
return queries;
Expand Down
Expand Up @@ -334,28 +334,24 @@ public Iterable<ParameterSet> getParameters() {
*/
protected static final ImmutableMap<String, Boolean> ENABLE_NONE = ImmutableMap.of(
// All false
ChromeFeatureList.RELATED_SEARCHES, false, ChromeFeatureList.RELATED_SEARCHES_IN_BAR,
false, ChromeFeatureList.RELATED_SEARCHES_UI, false,
ChromeFeatureList.RELATED_SEARCHES, false, ChromeFeatureList.RELATED_SEARCHES_UI, false,
ChromeFeatureList.CONTEXTUAL_SEARCH_FORCE_CAPTION, false);

/** This is the Related Searches Feature in the MVP configuration. */
private static final ImmutableMap<String, Boolean> ENABLE_RELATED_SEARCHES = ImmutableMap.of(
// Related Searches needs these 3:
ChromeFeatureList.RELATED_SEARCHES, true, ChromeFeatureList.RELATED_SEARCHES_IN_BAR,
true, ChromeFeatureList.RELATED_SEARCHES_UI, true,
ChromeFeatureList.RELATED_SEARCHES, true, ChromeFeatureList.RELATED_SEARCHES_UI, true,
ChromeFeatureList.CONTEXTUAL_SEARCH_FORCE_CAPTION, false);

/** This is the helper-text Feature. */
private static final ImmutableMap<String, Boolean> ENABLE_FORCE_CAPTION = ImmutableMap.of(
ChromeFeatureList.RELATED_SEARCHES, false, ChromeFeatureList.RELATED_SEARCHES_IN_BAR,
false, ChromeFeatureList.RELATED_SEARCHES_UI, false,
ChromeFeatureList.RELATED_SEARCHES, false, ChromeFeatureList.RELATED_SEARCHES_UI, false,
// Just this one enabled:
ChromeFeatureList.CONTEXTUAL_SEARCH_FORCE_CAPTION, true);

/** This is the helper-text Feature with Related Searches */
private static final ImmutableMap<String, Boolean> ENABLE_FORCE_CAPTION_WITH_RELATED_SEARCHES =
ImmutableMap.of(ChromeFeatureList.RELATED_SEARCHES, true,
ChromeFeatureList.RELATED_SEARCHES_IN_BAR, true,
ChromeFeatureList.RELATED_SEARCHES_UI, true,
ChromeFeatureList.CONTEXTUAL_SEARCH_FORCE_CAPTION, true);

Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/about_flags.cc
Expand Up @@ -3344,9 +3344,6 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kRelatedSearchesUi,
kRelatedSearchesUiVariations,
"RelatedSearchesUi")},
{"related-searches-in-bar", flag_descriptions::kRelatedSearchesInBarName,
flag_descriptions::kRelatedSearchesInBarDescription, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kRelatedSearchesInBar)},
#endif // BUILDFLAG(IS_ANDROID)
{"show-autofill-type-predictions",
flag_descriptions::kShowAutofillTypePredictionsName,
Expand Down
15 changes: 0 additions & 15 deletions chrome/browser/flag-metadata.json
Expand Up @@ -6045,21 +6045,6 @@
"owners": [ "gangwu", "related-searches-vteam@google.com" ],
"expiry_milestone": 110
},
{
"name": "related-searches-alternate-ux",
"owners": [ "gangwu", "related-searches-vteam@google.com" ],
"expiry_milestone": 110
},
{
"name": "related-searches-in-bar",
"owners": [ "gangwu", "related-searches-vteam@google.com" ],
"expiry_milestone": 110
},
{
"name": "related-searches-simplified-ux",
"owners": [ "gangwu", "related-searches-vteam@google.com" ],
"expiry_milestone": 110
},
{
"name": "related-searches-ui",
"owners": [ "gangwu", "related-searches-vteam@google.com" ],
Expand Down
6 changes: 0 additions & 6 deletions chrome/browser/flag_descriptions.cc
Expand Up @@ -3896,12 +3896,6 @@ const char kRelatedSearchesDescription[] =
"Enables requesting related searches suggestions. These will be requested "
"but not shown unless the UI flag is also enabled.";

const char kRelatedSearchesInBarName[] =
"Enables showing Related Searches in the peeking bar.";
const char kRelatedSearchesInBarDescription[] =
"Enables showing related searches suggestions in a carousel in the "
"peeking bar of the bottom sheet on Android.";

const char kRelatedSearchesUiName[] =
"Forces showing of the Related Searches UI on Android";
const char kRelatedSearchesUiDescription[] =
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.h
Expand Up @@ -2234,9 +2234,6 @@ extern const char kReengagementNotificationDescription[];
extern const char kRelatedSearchesName[];
extern const char kRelatedSearchesDescription[];

extern const char kRelatedSearchesInBarName[];
extern const char kRelatedSearchesInBarDescription[];

extern const char kRelatedSearchesUiName[];
extern const char kRelatedSearchesUiDescription[];

Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/flags/android/chrome_feature_list.cc
Expand Up @@ -253,7 +253,6 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&kRecordSuppressionMetrics,
&kReengagementNotification,
&kRelatedSearches,
&kRelatedSearchesInBar,
&kRelatedSearchesUi,
&kReportParentalControlSitesChild,
&kRequestDesktopSiteDefaults,
Expand Down Expand Up @@ -809,10 +808,6 @@ BASE_FEATURE(kRelatedSearches,
"RelatedSearches",
base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kRelatedSearchesInBar,
"RelatedSearchesInBar",
base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kRelatedSearchesUi,
"RelatedSearchesUi",
base::FEATURE_ENABLED_BY_DEFAULT);
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/flags/android/chrome_feature_list.h
Expand Up @@ -120,7 +120,6 @@ BASE_DECLARE_FEATURE(kReengagementNotification);
BASE_DECLARE_FEATURE(kReaderModeInCCT);
BASE_DECLARE_FEATURE(kRecordSuppressionMetrics);
BASE_DECLARE_FEATURE(kRelatedSearches);
BASE_DECLARE_FEATURE(kRelatedSearchesInBar);
BASE_DECLARE_FEATURE(kRelatedSearchesUi);
BASE_DECLARE_FEATURE(kReportParentalControlSitesChild);
BASE_DECLARE_FEATURE(kRequestDesktopSiteDefaults);
Expand Down
Expand Up @@ -442,7 +442,6 @@ public static boolean getFieldTrialParamByFeatureAsBoolean(
public static final String RECOVER_FROM_NEVER_SAVE_ANDROID = "RecoverFromNeverSaveAndroid";
public static final String REENGAGEMENT_NOTIFICATION = "ReengagementNotification";
public static final String RELATED_SEARCHES = "RelatedSearches";
public static final String RELATED_SEARCHES_IN_BAR = "RelatedSearchesInBar";
public static final String RELATED_SEARCHES_UI = "RelatedSearchesUi";
public static final String REPORT_PARENTAL_CONTROL_SITES_CHILD =
"ReportParentalControlSitesChild";
Expand Down

0 comments on commit 7229745

Please sign in to comment.