From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: fgei Date: Sat, 3 Sep 2022 08:15:59 +0200 Subject: [PATCH] Support opening external web search in incognito --- .../chromium/chrome/browser/searchwidget/SearchActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java index 9a426bfdd7843..9a0615f63674e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java @@ -32,6 +32,7 @@ import org.chromium.base.supplier.UnownedUserDataSupplier; import org.chromium.blink.mojom.DisplayMode; import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.TabPreferencesUtils; import org.chromium.chrome.browser.WebContentsFactory; import org.chromium.chrome.browser.app.omnibox.ActionChipsDelegateImpl; import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton; @@ -532,6 +533,8 @@ public class SearchActivity extends AsyncInitializationActivity } if (isFromSearchWidget()) { intent.putExtra(SearchWidgetProvider.EXTRA_FROM_SEARCH_WIDGET, true); + } else if (TabPreferencesUtils.shouldOpenLinksInIncognito()) { + intent = TabPreferencesUtils.appendNeededIncognitoExtras(this, intent); } intent.putExtra(EXTRA_FROM_SEARCH_ACTIVITY, true); IntentUtils.addTrustedIntentExtras(intent);