Skip to content

Commit

Permalink
#580 Use list mode for tab switcher
Browse files Browse the repository at this point in the history
test of #403
related #538 #180
  • Loading branch information
uazo committed Dec 13, 2023
1 parent 65f68be commit e7e9329
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/bromite_patches_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Timezone-customization.patch
00Always-allow-inspect-fallback.patch
00Add-cromite-flags-support.patch
00Add-PartialLowEndModeOnMidRangeDevices-flag.patch
00Use-list-mode-for-tab-switcher.patch

00Temp-PerformanceNavigationTiming-privacy-fix.patch
00Temp-disable-predictive-back-gesture.patch
Expand Down
70 changes: 70 additions & 0 deletions build/patches/00Use-list-mode-for-tab-switcher.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From: uazo <[email protected]>
Date: Tue, 12 Dec 2023 16:38:10 +0000
Subject: Use list mode for tab switcher

Added a setting for the option

need: Add-cromite-flags-support.patch
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../tasks/tab_management/TabUiFeatureUtilities.java | 2 +-
chrome/android/java/res/xml/privacy_preferences.xml | 7 +++++++
.../Use-list-mode-for-tab-switcher.grdp | 9 +++++++++
.../chrome_feature_list_cc/tab-switcher-list-mode.inc | 3 +++
4 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-list-mode-for-tab-switcher.grdp
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc

diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiFeatureUtilities.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiFeatureUtilities.java
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiFeatureUtilities.java
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiFeatureUtilities.java
@@ -116,7 +116,7 @@ public class TabUiFeatureUtilities {
*/
public static boolean shouldUseListMode(Context context) {
// Low-end forces list mode.
- return SysUtils.isLowEndDevice();
+ return ChromeFeatureList.isEnabled("TabSwitcherListMode");
}

/**
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -73,6 +73,13 @@ found in the LICENSE file.
android:summary="@string/settings_incognito_tab_lock_summary_android_setting_off"
android:persistent="false" />

+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="use_tab_switcher_list_mode"
+ android:title="@string/tab_switcher_list_mode_title"
+ android:summary="@string/tab_switcher_list_mode_summary"
+ app:featureName="TabSwitcherListMode"
+ app:needRestart="true" />
+
<PreferenceCategory
android:key="security_section"
android:title="@string/security_section_title" />
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-list-mode-for-tab-switcher.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-list-mode-for-tab-switcher.grdp
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-list-mode-for-tab-switcher.grdp
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grit-part>
+ <message name="IDS_TAB_SWITCHER_LIST_MODE_TITLE" desc="Text for 'Use list mode for tab switcher' settings-privacy option.">
+ Use list mode for tab switcher
+ </message>
+ <message name="IDS_TAB_SWITCHER_LIST_MODE_SUMMARY" desc="Summary text for 'Use list mode for tab switcher' settings-privacy option.">
+ Activates the list view of tabs in the tab switcher
+ </message>
+</grit-part>
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc
@@ -0,0 +1,3 @@
+CROMITE_FEATURE(kTabSwitcherListMode,
+ "TabSwitcherListMode",
+ base::FEATURE_DISABLED_BY_DEFAULT);
--
2.25.1

0 comments on commit e7e9329

Please sign in to comment.