From 0540e3ac7854f5b26c86f26ef009d7bc2bae13a9 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Mon, 30 Jan 2023 16:32:51 +0100 Subject: [PATCH] v109 - fix some issue https://github.com/uazo/bromite-buildtools/issues/33#issuecomment-1408104271 --- build/bromite_patches_list.txt | 6 +- ...-Move-navigation-bar-to-bottom-fixup.patch | 84 +++++++++++++++++++ ...9-Add-an-always-incognito-mode-fixup.patch | 40 +++++++++ ...xperimental-relative-c---abi-vtables.patch | 27 ++++++ .../00Viewport-Protection-Site-Setting.patch | 2 +- 5 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 build/patches/00109-2-Move-navigation-bar-to-bottom-fixup.patch create mode 100644 build/patches/00109-Add-an-always-incognito-mode-fixup.patch create mode 100644 build/patches/00Remove-experimental-relative-c---abi-vtables.patch diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index d25a4c8f..60f15987 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -266,4 +266,8 @@ AudioBuffer-AnalyserNode-fp-mitigations.patch 00win-disable-annotate-downloads.patch 00win-enable-HighEfficiencyMode-by-default.patch 00109-Move-navigation-bar-to-bottom-fixup.patch -00Partitioning-all-cookies-by-top-frame-domain.patch \ No newline at end of file +00Partitioning-all-cookies-by-top-frame-domain.patch + +00109-2-Move-navigation-bar-to-bottom-fixup.patch +00109-Add-an-always-incognito-mode-fixup.patch +00Remove-experimental-relative-c---abi-vtables.patch \ No newline at end of file diff --git a/build/patches/00109-2-Move-navigation-bar-to-bottom-fixup.patch b/build/patches/00109-2-Move-navigation-bar-to-bottom-fixup.patch new file mode 100644 index 00000000..b0e1cab2 --- /dev/null +++ b/build/patches/00109-2-Move-navigation-bar-to-bottom-fixup.patch @@ -0,0 +1,84 @@ +From: Your Name +Date: Mon, 30 Jan 2023 15:13:51 +0000 +Subject: 109-2 Move navigation bar to bottom fixup + +--- + .../tasks/tab_management/TabListCoordinator.java | 8 +++++--- + .../DropdownItemViewInfoListManager.java | 15 +++++++++++---- + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java +--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java ++++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java +@@ -139,8 +139,10 @@ public class TabListCoordinator + + @Override + public void scrollToPositionWithOffset(int position, int offset) { +- mLastPosition = position; +- super.scrollToPositionWithOffset(position, getPaddingBottom()); ++ if (mIsFirstLayout) { ++ mLastPosition = position; ++ super.scrollToPositionWithOffset(mLastPosition, getPaddingBottom()); ++ } + } + + @Override +@@ -152,8 +154,8 @@ public class TabListCoordinator + if (lastView != null) { + mTopPadding = Math.min(mTopPadding, mRecyclerView.getHeight() - lastView.getHeight()); + if (mIsFirstLayout) { +- mIsFirstLayout = false; + scrollToPositionWithOffset(mLastPosition, 0); ++ mIsFirstLayout = false; + } + } + +diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager.java +--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager.java ++++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager.java +@@ -11,6 +11,8 @@ import android.view.View; + import androidx.annotation.NonNull; + import androidx.annotation.Px; + ++import org.chromium.chrome.browser.flags.CachedFeatureFlags; ++import org.chromium.chrome.browser.flags.ChromeFeatureList; + import org.chromium.chrome.browser.omnibox.OmniboxFeatures; + import org.chromium.chrome.browser.omnibox.R; + import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; +@@ -165,6 +167,7 @@ class DropdownItemViewInfoListManager { + GroupSection previousSection = null; + GroupSection currentSection; + ++ boolean toolbarToBottom = ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled(); + for (int i = 0; i < mSourceViewInfoList.size(); i++) { + final DropdownItemViewInfo item = mSourceViewInfoList.get(i); + final PropertyModel model = item.model; +@@ -180,18 +183,22 @@ class DropdownItemViewInfoListManager { + var topMargin = applyRounding ? groupTopMargin : suggestionVerticalMargin; + var bottomMargin = applyRounding ? groupBottomMargin : suggestionVerticalMargin; + +- model.set(DropdownCommonProperties.BG_TOP_CORNER_ROUNDED, applyRounding); ++ model.set(toolbarToBottom ? ++ DropdownCommonProperties.BG_BOTTOM_CORNER_ROUNDED : ++ DropdownCommonProperties.BG_TOP_CORNER_ROUNDED, applyRounding); + // Do not have margin for the first suggestion, otherwise the first suggestion will + // have a big gap with the Omnibox. +- model.set(DropdownCommonProperties.TOP_MARGIN, ++ model.set(toolbarToBottom ? DropdownCommonProperties.BOTTOM_MARGIN : DropdownCommonProperties.TOP_MARGIN, + previousItem == null + ? getSuggestionListTopMargin(item.processor.getViewTypeId()) + : topMargin); + + if (previousItem != null) { + previousItem.model.set( +- DropdownCommonProperties.BG_BOTTOM_CORNER_ROUNDED, applyRounding); +- previousItem.model.set(DropdownCommonProperties.BOTTOM_MARGIN, bottomMargin); ++ toolbarToBottom ? ++ DropdownCommonProperties.BG_TOP_CORNER_ROUNDED : ++ DropdownCommonProperties.BG_BOTTOM_CORNER_ROUNDED, applyRounding); ++ previousItem.model.set(toolbarToBottom ? DropdownCommonProperties.TOP_MARGIN : DropdownCommonProperties.BOTTOM_MARGIN, bottomMargin); + } + + previousItem = item; +-- +2.25.1 diff --git a/build/patches/00109-Add-an-always-incognito-mode-fixup.patch b/build/patches/00109-Add-an-always-incognito-mode-fixup.patch new file mode 100644 index 00000000..a4b021dd --- /dev/null +++ b/build/patches/00109-Add-an-always-incognito-mode-fixup.patch @@ -0,0 +1,40 @@ +From: Your Name +Date: Mon, 30 Jan 2023 15:14:09 +0000 +Subject: 109 Add an always-incognito mode fixup + +--- + .../chrome/browser/ChromeTabbedActivity.java | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +@@ -59,6 +59,9 @@ import org.chromium.base.task.PostTask; + import org.chromium.build.annotations.UsedByReflection; + import org.chromium.cc.input.BrowserControlsState; + import org.chromium.chrome.R; ++import org.chromium.components.prefs.PrefService; ++import org.chromium.components.user_prefs.UserPrefs; ++import org.chromium.chrome.browser.preferences.Pref; + import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; + import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate; + import org.chromium.chrome.browser.IntentHandler.TabOpenType; +@@ -583,9 +586,13 @@ public class ChromeTabbedActivity extends ChromeActivity +Date: Mon, 30 Jan 2023 15:20:53 +0000 +Subject: Remove experimental-relative-c++-abi-vtables + +--- + build/config/android/BUILD.gn | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn +--- a/build/config/android/BUILD.gn ++++ b/build/config/android/BUILD.gn +@@ -45,13 +45,6 @@ config("compiler") { + # by shrinking the alignment gap between segments. This also causes all + # segments to be mapped adjacently, which breakpad relies on. + ldflags += [ "-Wl,-z,max-page-size=4096" ] +- +- # Use non-standard (non-Itanium) ABI for Android64. This shrinks vtables +- # in half and places them to .rodata, which greatly improves memory +- # footprint. It should be safe, assuming all of C++ in Chromium is +- # compiled with this flag. +- cflags_cc = [ "-fexperimental-relative-c++-abi-vtables" ] +- ldflags += [ "-fexperimental-relative-c++-abi-vtables" ] + } + + if (current_cpu == "arm64") { +-- +2.25.1 diff --git a/build/patches/00Viewport-Protection-Site-Setting.patch b/build/patches/00Viewport-Protection-Site-Setting.patch index 59cac9ae..328b49e4 100644 --- a/build/patches/00Viewport-Protection-Site-Setting.patch +++ b/build/patches/00Viewport-Protection-Site-Setting.patch @@ -460,7 +460,7 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. /*permission_type_ui*/ IDS_SITE_SETTINGS_TYPE_WEBRTC, /*permission_type_ui_mid_sentence*/ IDS_SITE_SETTINGS_TYPE_WEBRTC_MID_SENTENCE); + -+ Register(ContentSettingsType::VIEWPORT, "viewport", CONTENT_SETTING_BLOCK, ++ Register(ContentSettingsType::VIEWPORT, "viewport", CONTENT_SETTING_ALLOW, + WebsiteSettingsInfo::SYNCABLE, + /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW,