Commit e85fcad2 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Cache TabGroupsContinuation feature flag

http://crrev.com/c/1934832 introduces the flag check for
TabGroupsContinuation in isGridTabSwitcherEnabled() which could happen
before native is started. This means that we need to cache the
TabGroupsContinuation flag as well. This CL fixes this issue and fixes
related tests.

Bug: 1057586
Change-Id: I4edaca4c202bdd19d2da04a5224d727100673947
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2085601
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747058}
parent fa9d3cb6
......@@ -69,7 +69,8 @@ public class TabUiFeatureUtilities {
}
return Arrays.asList(ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID,
ChromeFeatureList.TAB_GROUPS_ANDROID,
ChromeFeatureList.DUET_TABSTRIP_INTEGRATION_ANDROID);
ChromeFeatureList.DUET_TABSTRIP_INTEGRATION_ANDROID,
ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID);
}
private static boolean isEligibleForTabUiExperiments() {
......@@ -86,7 +87,7 @@ public class TabUiFeatureUtilities {
// TODO(yusufo): AccessibilityLayout check should not be here and the flow should support
// changing that setting while Chrome is alive.
// Having Tab Groups or Start implies Grid Tab Switcher.
return !(ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID)
return !(CachedFeatureFlags.isEnabled(ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID)
&& SysUtils.isLowEndDevice())
&& CachedFeatureFlags.isEnabled(ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID)
&& isTabManagementModuleSupported()
......@@ -115,7 +116,7 @@ public class TabUiFeatureUtilities {
*/
public static boolean isTabGroupsAndroidContinuationEnabled() {
return isTabGroupsAndroidEnabled()
&& ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID);
&& CachedFeatureFlags.isEnabled(ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID);
}
/**
......
......@@ -63,6 +63,7 @@ public class CachedFeatureFlags {
put(ChromeFeatureList.PAINT_PREVIEW_TEST, false);
put(ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID, false);
put(ChromeFeatureList.TAB_GROUPS_ANDROID, false);
put(ChromeFeatureList.TAB_GROUPS_CONTINUATION_ANDROID, false);
put(ChromeFeatureList.DUET_TABSTRIP_INTEGRATION_ANDROID, false);
put(ChromeFeatureList.SHARE_BUTTON_IN_TOP_TOOLBAR, false);
put(ChromeFeatureList.TEST_DEFAULT_DISABLED, false);
......
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