From bc2dc716c4d9e793eeec481ec0f0a6e88c8c6c1a Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 21 Jun 2023 15:42:03 +0200 Subject: [PATCH] fixed the correct parameter reading --- ...Delete-block-external-form-redirects.patch | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build/patches/Revert-Delete-block-external-form-redirects.patch b/build/patches/Revert-Delete-block-external-form-redirects.patch index a3e022cd..e4701c07 100644 --- a/build/patches/Revert-Delete-block-external-form-redirects.patch +++ b/build/patches/Revert-Delete-block-external-form-redirects.patch @@ -11,16 +11,16 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/flag-metadata.json | 5 +++++ chrome/browser/flag_descriptions.cc | 6 ++++++ chrome/browser/flag_descriptions.h | 3 +++ - .../android/external_intents_features.cc | 6 +++++- + .../android/external_intents_features.cc | 7 ++++++- .../android/external_intents_features.h | 1 + .../ExternalIntentsFeatures.java | 6 ++++++ .../ExternalNavigationHandler.java | 21 +++++++++++++++++++ - 8 files changed, 54 insertions(+), 1 deletion(-) + 8 files changed, 55 insertions(+), 1 deletion(-) diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -242,6 +242,7 @@ +@@ -241,6 +241,7 @@ #include "chrome/browser/push_messaging/push_messaging_features.h" #include "components/browser_ui/photo_picker/android/features.h" #include "components/content_creation/notes/core/note_features.h" @@ -28,7 +28,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc #include "components/translate/content/android/translate_message.h" #include "ui/android/ui_android_features.h" #else // BUILDFLAG(IS_ANDROID) -@@ -7760,6 +7761,12 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7756,6 +7757,12 @@ const FeatureEntry kFeatureEntries[] = { #endif // BUILDFLAG(ENABLE_PAINT_PREVIEW) && BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID) @@ -59,7 +59,7 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.js diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -3977,6 +3977,12 @@ const char kInstantStartName[] = "Instant start"; +@@ -3971,6 +3971,12 @@ const char kInstantStartName[] = "Instant start"; const char kInstantStartDescription[] = "Show start surface before native library is loaded."; @@ -75,7 +75,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h -@@ -2310,6 +2310,9 @@ extern const char kInstanceSwitcherDescription[]; +@@ -2307,6 +2307,9 @@ extern const char kInstanceSwitcherDescription[]; extern const char kInstantStartName[]; extern const char kInstantStartDescription[]; @@ -88,18 +88,15 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio diff --git a/components/external_intents/android/external_intents_features.cc b/components/external_intents/android/external_intents_features.cc --- a/components/external_intents/android/external_intents_features.cc +++ b/components/external_intents/android/external_intents_features.cc -@@ -18,9 +18,9 @@ namespace { - - // Array of features exposed through the Java ExternalIntentsFeatures API. +@@ -20,7 +20,6 @@ namespace { const base::Feature* kFeaturesExposedToJava[] = { -+ &kIntentBlockExternalFormRedirectsNoGesture, &kExternalNavigationDebugLogs, &kBlockFrameRenavigations, &kDoNotRequireSpecializedCCTHandler, &kBlockIntentsToSelf}; - } // namespace // Alphabetical: -@@ -41,6 +41,10 @@ BASE_FEATURE(kBlockIntentsToSelf, +@@ -41,7 +40,13 @@ BASE_FEATURE(kBlockIntentsToSelf, "BlockIntentsToSelf", base::FEATURE_ENABLED_BY_DEFAULT); @@ -108,8 +105,11 @@ diff --git a/components/external_intents/android/external_intents_features.cc b/ + base::FEATURE_ENABLED_BY_DEFAULT); + static jlong JNI_ExternalIntentsFeatures_GetFeature(JNIEnv* env, jint ordinal) { ++ if (ordinal == -1) ++ return reinterpret_cast(&kIntentBlockExternalFormRedirectsNoGesture); return reinterpret_cast(kFeaturesExposedToJava[ordinal]); } + diff --git a/components/external_intents/android/external_intents_features.h b/components/external_intents/android/external_intents_features.h --- a/components/external_intents/android/external_intents_features.h +++ b/components/external_intents/android/external_intents_features.h @@ -132,7 +132,7 @@ diff --git a/components/external_intents/android/java/src/org/chromium/component + "IntentBlockExternalFormRedirectsNoGesture"; + + public static final ExternalIntentsFeatures INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE = -+ new ExternalIntentsFeatures(0, INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE_NAME); ++ new ExternalIntentsFeatures(-1, INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE_NAME); + public static final String EXTERNAL_NAVIGATION_DEBUG_LOGS_NAME = "ExternalNavigationDebugLogs"; public static final String BLOCK_FRAME_RENAVIGATIONS_NAME = "BlockFrameRenavigations2";