Adjust patch for incognito custom tabs support
This commit is contained in:
parent
ed55ac3551
commit
efeb280c3a
3 changed files with 49 additions and 40 deletions
|
@ -141,4 +141,4 @@ Automated-domain-substitution.patch
|
|||
show-download-prompt-again-by-default.patch
|
||||
disable-browser-autologin-by-default.patch
|
||||
Always-incognito-crashes-fix.patch
|
||||
Enable-incognito-custom-tab.patch
|
||||
Enable-incognito-custom-tabs.patch
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
|
||||
@@ -50,9 +50,10 @@ public class CustomTabIncognitoManager implements NativeInitObserver, Destroyabl
|
||||
|
||||
@Override
|
||||
public void onFinishNativeInitialization() {
|
||||
- assert ChromeFeatureList.isInitialized();
|
||||
+ //assert ChromeFeatureList.isInitialized();
|
||||
if (mIntentDataProvider.isIncognito()
|
||||
- && ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_INCOGNITO)) {
|
||||
+ //&& ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_INCOGNITO)) {
|
||||
+ ) {
|
||||
initializeIncognito();
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
@@ -50,6 +50,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable;
|
||||
import org.chromium.components.embedder_support.util.UrlConstants;
|
||||
import org.chromium.ui.util.ColorUtils;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
|
||||
+
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
@@ -398,6 +401,9 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
// TODO(https://crbug.com/1023759): Remove this function and enable
|
||||
// incognito CCT request for all apps.
|
||||
private boolean isValidIncognitoIntent(Intent intent) {
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
|
||||
+ return true;
|
||||
+ }
|
||||
if (!isIncognitoRequested(intent)) return false;
|
||||
// Incognito requests for payments flow are supported without
|
||||
// INCOGNITO_CCT flag as an exceptional case that can use Chrome
|
48
build/patches/Enable-incognito-custom-tabs.patch
Normal file
48
build/patches/Enable-incognito-custom-tabs.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 22 Apr 2020 18:57:01 +0200
|
||||
Subject: Enable incognito custom tabs
|
||||
|
||||
Fixes https://github.com/bromite/bromite/issues/132 and crashes introduced for the fix of https://github.com/bromite/bromite/issues/453
|
||||
---
|
||||
.../browser/customtabs/CustomTabIntentDataProvider.java | 6 ++++++
|
||||
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
@@ -53,6 +53,9 @@ import org.chromium.components.browser_ui.styles.ChromeColors;
|
||||
import org.chromium.components.browser_ui.widget.TintedDrawable;
|
||||
import org.chromium.ui.util.ColorUtils;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
|
||||
+
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
@@ -455,6 +458,9 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
// TODO(https://crbug.com/1023759): Remove this function and enable
|
||||
// incognito CCT request for all apps.
|
||||
private boolean isValidIncognitoIntent(Intent intent) {
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
|
||||
+ return true;
|
||||
+ }
|
||||
if (!isIncognitoRequested(intent)) return false;
|
||||
// Incognito requests for payments flow are supported without
|
||||
// INCOGNITO_CCT flag as an exceptional case that can use Chrome
|
||||
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
|
||||
@@ -337,7 +337,7 @@ const base::Feature kCCTExternalLinkHandling{"CCTExternalLinkHandling",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kCCTIncognito{"CCTIncognito",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kCCTModule{"CCTModule", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
Loading…
Add table
Reference in a new issue