Enable incognito custom tab
This commit is contained in:
parent
41f3eb6400
commit
2144f48a52
2 changed files with 40 additions and 0 deletions
|
@ -140,3 +140,4 @@ Add-missing-android_provider.patch
|
|||
Automated-domain-substitution.patch
|
||||
show-download-prompt-again-by-default.patch
|
||||
disable-browser-autologin-by-default.patch
|
||||
Enable-incognito-custom-tab.patch
|
||||
|
|
39
build/patches/Enable-incognito-custom-tab.patch
Normal file
39
build/patches/Enable-incognito-custom-tab.patch
Normal file
|
@ -0,0 +1,39 @@
|
|||
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
|
Loading…
Add table
Reference in a new issue