forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |