Loading CHANGELOG.md +4 −1 Original line number Diff line number Diff line # 91.0.4472.97 # 91.0.4472.102 * fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154) * allow saving pages in incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182) # 91.0.4472.97 * add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152) * enable IntentBlockExternalFormRedirectsNoGesture by default * add flag to disable external intent requests Loading build/RELEASE +1 −1 Original line number Diff line number Diff line 91.0.4472.97 91.0.4472.102 build/patches/Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmp --- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl +++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl @@ -147,10 +147,6 @@ public abstract class ChromeSwitches {{ /** Switch for enabling the Chrome Survey. */ /** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */ public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey"; - /** Switch to enable incognito tabs to be seen in Android Recents. */ Loading build/patches/Add-an-always-incognito-mode.patch +26 −50 Original line number Diff line number Diff line Loading @@ -10,10 +10,10 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c chrome/android/chrome_java_sources.gni | 1 + .../java/res/xml/privacy_preferences.xml | 5 ++ .../AlwaysIncognitoLinkInterceptor.java | 80 +++++++++++++++++++ .../chrome/browser/ChromeTabbedActivity.java | 8 +- .../chrome/browser/ChromeTabbedActivity.java | 6 +- .../chrome/browser/app/ChromeActivity.java | 4 + .../AppMenuPropertiesDelegateImpl.java | 6 ++ .../ChromeContextMenuPopulator.java | 28 +++++-- .../ChromeContextMenuPopulator.java | 9 ++- .../CustomTabActivityLifecycleUmaTracker.java | 25 ------ .../CustomTabIntentDataProvider.java | 5 +- .../browser/init/StartupTabPreloader.java | 14 +++- Loading @@ -23,7 +23,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c .../webapps/WebappIntentDataProvider.java | 14 ++++ .../flags/android/chrome_feature_list.cc | 2 +- .../strings/android_chrome_strings.grd | 7 ++ 16 files changed, 187 insertions(+), 39 deletions(-) 16 files changed, 171 insertions(+), 34 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni Loading Loading @@ -160,15 +160,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct int index = savedInstanceState != null ? savedInstanceState.getInt(WINDOW_INDEX, 0) : 0; mNextTabPolicySupplier = new ChromeNextTabPolicySupplier(mOverviewModeBehaviorSupplier); @@ -1714,7 +1716,7 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent public void onTabStateInitialized() { if (!mCreatedTabOnStartup) return; - TabModel model = mTabModelSelectorImpl.getModel(false); + TabModel model = mTabModelSelectorImpl.getModel(startIncognito); TasksUma.recordTasksUma(model); } }); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java Loading Loading @@ -219,49 +210,34 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator.ContextMenuUma.Action; @@ -331,6 +333,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { params.getLinkUrl().getSpec()); } @@ -336,6 +338,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { boolean hasSaveImage = false; mShowEphemeralTabNewLabel = null; + /** + * Disallow opening in a new tab when in always-incognito mode. + */ + private static boolean canOpenNewTab() { + if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false) + /*&& !mItemDelegate.isIncognito()*/) { + return false; + } + return true; + } + boolean always_incognito = + ContextUtils.getAppSharedPreferences().getBoolean( + AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false); + + @Override public List<Pair<Integer, ModelList>> buildContextMenu() { boolean hasSaveImage = false; @@ -344,14 +358,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { && UrlUtilities.isAcceptedScheme(mParams.getUrl().getSpec())) { if (mMode == ContextMenuMode.NORMAL) { if (TabUiFeatureUtilities.ENABLE_TAB_GROUP_AUTO_CREATION.getValue()) { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + if (canOpenNewTab()) linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); } else { if (TabUiFeatureUtilities.showContextMenuOpenNewTabInGroupItemFirst()) { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + if (canOpenNewTab()) { + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + } } else { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + if (canOpenNewTab()) { + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + } List<Pair<Integer, ModelList>> groupedItems = new ArrayList<>(); if (mParams.isAnchor()) { @@ -354,6 +360,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); } } + if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) { linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB)); } @@ -376,7 +383,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { } } if (FirstRunStatus.getFirstRunFlowComplete()) { - if (!mItemDelegate.isIncognito() + if ((always_incognito || !mItemDelegate.isIncognito()) && UrlUtilities.isDownloadableScheme(mParams.getLinkUrl())) { linkGroup.add(createListItem(Item.SAVE_LINK_AS)); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java Loading build/patches/Add-flag-to-disable-external-intent-requests.patch +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc flag_descriptions::kWebrtcCaptureMultiChannelApmName, flag_descriptions::kWebrtcCaptureMultiChannelApmDescription, kOsAll, FEATURE_VALUE_TYPE(features::kWebRtcEnableCaptureMultiChannelApm)}, + {switches::kDisableExternalIntentRequests, flag_descriptions::kDisableExternalIntentRequestsName, + {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName, + flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll, + SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")}, {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName, Loading Loading
CHANGELOG.md +4 −1 Original line number Diff line number Diff line # 91.0.4472.97 # 91.0.4472.102 * fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154) * allow saving pages in incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182) # 91.0.4472.97 * add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152) * enable IntentBlockExternalFormRedirectsNoGesture by default * add flag to disable external intent requests Loading
build/patches/Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmp --- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl +++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl @@ -147,10 +147,6 @@ public abstract class ChromeSwitches {{ /** Switch for enabling the Chrome Survey. */ /** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */ public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey"; - /** Switch to enable incognito tabs to be seen in Android Recents. */ Loading
build/patches/Add-an-always-incognito-mode.patch +26 −50 Original line number Diff line number Diff line Loading @@ -10,10 +10,10 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c chrome/android/chrome_java_sources.gni | 1 + .../java/res/xml/privacy_preferences.xml | 5 ++ .../AlwaysIncognitoLinkInterceptor.java | 80 +++++++++++++++++++ .../chrome/browser/ChromeTabbedActivity.java | 8 +- .../chrome/browser/ChromeTabbedActivity.java | 6 +- .../chrome/browser/app/ChromeActivity.java | 4 + .../AppMenuPropertiesDelegateImpl.java | 6 ++ .../ChromeContextMenuPopulator.java | 28 +++++-- .../ChromeContextMenuPopulator.java | 9 ++- .../CustomTabActivityLifecycleUmaTracker.java | 25 ------ .../CustomTabIntentDataProvider.java | 5 +- .../browser/init/StartupTabPreloader.java | 14 +++- Loading @@ -23,7 +23,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c .../webapps/WebappIntentDataProvider.java | 14 ++++ .../flags/android/chrome_feature_list.cc | 2 +- .../strings/android_chrome_strings.grd | 7 ++ 16 files changed, 187 insertions(+), 39 deletions(-) 16 files changed, 171 insertions(+), 34 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni Loading Loading @@ -160,15 +160,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct int index = savedInstanceState != null ? savedInstanceState.getInt(WINDOW_INDEX, 0) : 0; mNextTabPolicySupplier = new ChromeNextTabPolicySupplier(mOverviewModeBehaviorSupplier); @@ -1714,7 +1716,7 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent public void onTabStateInitialized() { if (!mCreatedTabOnStartup) return; - TabModel model = mTabModelSelectorImpl.getModel(false); + TabModel model = mTabModelSelectorImpl.getModel(startIncognito); TasksUma.recordTasksUma(model); } }); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java Loading Loading @@ -219,49 +210,34 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator.ContextMenuUma.Action; @@ -331,6 +333,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { params.getLinkUrl().getSpec()); } @@ -336,6 +338,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { boolean hasSaveImage = false; mShowEphemeralTabNewLabel = null; + /** + * Disallow opening in a new tab when in always-incognito mode. + */ + private static boolean canOpenNewTab() { + if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false) + /*&& !mItemDelegate.isIncognito()*/) { + return false; + } + return true; + } + boolean always_incognito = + ContextUtils.getAppSharedPreferences().getBoolean( + AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false); + + @Override public List<Pair<Integer, ModelList>> buildContextMenu() { boolean hasSaveImage = false; @@ -344,14 +358,18 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { && UrlUtilities.isAcceptedScheme(mParams.getUrl().getSpec())) { if (mMode == ContextMenuMode.NORMAL) { if (TabUiFeatureUtilities.ENABLE_TAB_GROUP_AUTO_CREATION.getValue()) { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + if (canOpenNewTab()) linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); } else { if (TabUiFeatureUtilities.showContextMenuOpenNewTabInGroupItemFirst()) { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + if (canOpenNewTab()) { + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + } } else { - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); - linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + if (canOpenNewTab()) { + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); + linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); + } List<Pair<Integer, ModelList>> groupedItems = new ArrayList<>(); if (mParams.isAnchor()) { @@ -354,6 +360,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); } } + if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) { linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB)); } @@ -376,7 +383,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { } } if (FirstRunStatus.getFirstRunFlowComplete()) { - if (!mItemDelegate.isIncognito() + if ((always_incognito || !mItemDelegate.isIncognito()) && UrlUtilities.isDownloadableScheme(mParams.getLinkUrl())) { linkGroup.add(createListItem(Item.SAVE_LINK_AS)); } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java Loading
build/patches/Add-flag-to-disable-external-intent-requests.patch +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc flag_descriptions::kWebrtcCaptureMultiChannelApmName, flag_descriptions::kWebrtcCaptureMultiChannelApmDescription, kOsAll, FEATURE_VALUE_TYPE(features::kWebRtcEnableCaptureMultiChannelApm)}, + {switches::kDisableExternalIntentRequests, flag_descriptions::kDisableExternalIntentRequestsName, + {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName, + flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll, + SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")}, {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName, Loading