LeOSium_webview/LeOS/patches/00Enable-ImprovedBookmarks-...

106 lines
6.1 KiB
Diff
Raw Normal View History

2023-11-18 11:46:19 +01:00
From: uazo <uazo@users.noreply.github.com>
Date: Tue, 12 Sep 2023 12:39:23 +0000
Subject: Enable ImprovedBookmarks by default
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/android/java/res/layout/bookmark_search_box_row.xml | 4 ++--
.../chromium/chrome/browser/bookmarks/BookmarkFeatures.java | 2 +-
.../browser/bookmarks/BookmarkSearchBoxRowViewBinder.java | 2 ++
.../chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java | 2 +-
.../org/chromium/chrome/browser/bookmarks/BookmarkUtils.java | 3 ++-
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
6 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/chrome/android/java/res/layout/bookmark_search_box_row.xml b/chrome/android/java/res/layout/bookmark_search_box_row.xml
--- a/chrome/android/java/res/layout/bookmark_search_box_row.xml
+++ b/chrome/android/java/res/layout/bookmark_search_box_row.xml
@@ -58,8 +58,8 @@ found in the LICENSE file.
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="48dp"
- android:layout_marginTop="6dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="0dp"
android:orientation="horizontal">
<org.chromium.components.browser_ui.widget.chips.ChipView
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java
@@ -14,7 +14,7 @@ import org.chromium.chrome.browser.flags.MutableFlagWithSafeDefault;
*/
public class BookmarkFeatures {
private static final MutableFlagWithSafeDefault sAndroidImprovedBookmarksFlag =
- new MutableFlagWithSafeDefault(ChromeFeatureList.ANDROID_IMPROVED_BOOKMARKS, false);
+ new MutableFlagWithSafeDefault(ChromeFeatureList.ANDROID_IMPROVED_BOOKMARKS, true);
/** Returns whether an additional "add bookmark" item should be in the overflow menu. */
public static boolean isBookmarkMenuItemAsDedicatedRowEnabled() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.bookmarks;
import android.view.View;
+import android.view.ViewGroup;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
@@ -53,6 +54,7 @@ class BookmarkSearchBoxRowViewBinder {
private void bindInternal(PropertyModel model, View view, PropertyKey key) {
BookmarkSearchBoxRow row = (BookmarkSearchBoxRow) view;
ChipView shoppingChip = view.findViewById(R.id.shopping_filter_chip);
+ shoppingChip.setVisibility(ViewGroup.GONE);
if (key == BookmarkSearchBoxRowProperties.SEARCH_TEXT_CHANGE_CALLBACK) {
Callback<String> callback =
wrapCallback(model, BookmarkSearchBoxRowProperties.SEARCH_TEXT_CHANGE_CALLBACK);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java
@@ -21,7 +21,7 @@ import java.lang.annotation.RetentionPolicy;
*/
public class BookmarkUiPrefs {
private static final @BookmarkRowDisplayPref int INITIAL_BOOKMARK_ROW_DISPLAY_PREF =
- BookmarkRowDisplayPref.VISUAL;
+ BookmarkRowDisplayPref.COMPACT;
private static final @BookmarkRowSortOrder int INITIAL_BOOKMARK_ROW_SORT_ORDER =
BookmarkRowSortOrder.MANUAL;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -38,6 +38,7 @@ import org.chromium.chrome.browser.app.bookmarks.BookmarkAddEditFolderActivity;
import org.chromium.chrome.browser.app.bookmarks.BookmarkEditActivity;
import org.chromium.chrome.browser.app.bookmarks.BookmarkFolderPickerActivity;
import org.chromium.chrome.browser.app.bookmarks.BookmarkFolderSelectActivity;
+import org.chromium.chrome.browser.bookmarks.BookmarkFeatures;
import org.chromium.chrome.browser.bookmarks.BookmarkUiPrefs.BookmarkRowDisplayPref;
import org.chromium.chrome.browser.commerce.ShoppingServiceFactory;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
@@ -405,7 +406,7 @@ public class BookmarkUtils {
RecordUserAction.record("MobileBookmarkManagerReopenBookmarksInSameSession");
}
- if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(context)) {
+ if (BookmarkFeatures.isAndroidImprovedBookmarksEnabled() || DeviceFormFactor.isNonMultiDisplayContextOnTablet(context)) {
showBookmarkManagerOnTablet(context,
activity == null ? null : activity.getComponentName(), url, isIncognito);
} else {
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -509,7 +509,7 @@ BASE_FEATURE(kAndroidSearchEngineChoiceNotification,
BASE_FEATURE(kAndroidImprovedBookmarks,
"AndroidImprovedBookmarks",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kAndroidNoVisibleHintForTablets,
"AndroidNoVisibleHintForTablets",
--
2.25.1