Add an always-incognito mode: fix crash in history page (#2662)
This commit is contained in:
@@ -32,7 +32,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 5 +
|
||||
.../CustomTabIntentDataProvider.java | 10 +
|
||||
.../browser/download/DownloadUtils.java | 13 +-
|
||||
.../history/HistoryContentManager.java | 9 +-
|
||||
.../history/HistoryContentManager.java | 20 +-
|
||||
.../browser/history/HistoryManager.java | 27 ++-
|
||||
.../chrome/browser/history/HistoryPage.java | 16 ++
|
||||
.../native_page/NativePageFactory.java | 4 +-
|
||||
@@ -68,6 +68,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
chrome/browser/prefs/browser_prefs.cc | 5 +
|
||||
chrome/browser/profiles/profile_selections.cc | 10 +
|
||||
chrome/browser/profiles/profile_selections.h | 7 +-
|
||||
.../signin/services/ProfileDataCache.java | 3 +-
|
||||
.../browser/ui/android/native_page/BUILD.gn | 2 +
|
||||
.../browser/ui/native_page/NativePage.java | 17 +-
|
||||
.../browser/omnibox/LocationBarMediator.java | 8 +
|
||||
@@ -88,7 +89,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
.../add-an-always-incognito-mode.inc | 1 +
|
||||
.../add-an-always-incognito-mode.inc | 3 +
|
||||
.../add-an-always-incognito-mode.inc | 1 +
|
||||
69 files changed, 807 insertions(+), 106 deletions(-)
|
||||
70 files changed, 809 insertions(+), 118 deletions(-)
|
||||
create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml
|
||||
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
|
||||
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java
|
||||
@@ -500,7 +501,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java
|
||||
@@ -308,8 +308,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver
|
||||
@@ -240,16 +240,7 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver
|
||||
};
|
||||
mTabSupplier = tabSupplier;
|
||||
|
||||
- mHistorySyncPromoCoordinator =
|
||||
- new SigninPromoCoordinator(
|
||||
- mActivity,
|
||||
- profile,
|
||||
- new HistoryPageSigninPromoDelegate(
|
||||
- mActivity,
|
||||
- profile,
|
||||
- SigninAndHistorySyncActivityLauncherImpl.get(),
|
||||
- this::updateHistorySyncPromoVisibility,
|
||||
- /* isCreatedInCct= */ launchedForApp));
|
||||
+ mHistorySyncPromoCoordinator = null;
|
||||
|
||||
// History service is not keyed for Incognito profiles and {@link HistoryServiceFactory}
|
||||
// explicitly redirects to use regular profile for Incognito case.
|
||||
@@ -308,8 +299,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver
|
||||
mHistoryAdapter.generateFooterItems();
|
||||
|
||||
// Listen to changes in sign in state.
|
||||
@@ -512,7 +531,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History
|
||||
|
||||
// Create PrefChangeRegistrar to receive notifications on preference changes.
|
||||
mPrefChangeRegistrar = PrefServiceUtil.createFor(profile);
|
||||
@@ -386,8 +387,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver
|
||||
@@ -386,8 +378,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver
|
||||
mHistoryAdapter.onDestroyed();
|
||||
mLargeIconBridge.destroy();
|
||||
mLargeIconBridge = null;
|
||||
@@ -1878,6 +1897,24 @@ diff --git a/chrome/browser/profiles/profile_selections.h b/chrome/browser/profi
|
||||
kOwnInstance, // Original: Self -- OTR: Self
|
||||
kRedirectedToOriginal, // Original: Self -- OTR: Original
|
||||
kOffTheRecordOnly // Original: No Profile -- OTR: Self
|
||||
diff --git a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/ProfileDataCache.java b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/ProfileDataCache.java
|
||||
--- a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/ProfileDataCache.java
|
||||
+++ b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/ProfileDataCache.java
|
||||
@@ -134,13 +134,12 @@ public class ProfileDataCache implements AccountInfoService.Observer {
|
||||
@VisibleForTesting
|
||||
ProfileDataCache(
|
||||
Context context,
|
||||
- IdentityManager identityManager,
|
||||
+ IdentityManager identityManagerNotUsed,
|
||||
@Px int imageSize,
|
||||
@Nullable BadgeConfig badgeConfig) {
|
||||
// TODO(crbug.com/341948846): Remove AccountInfoService and update
|
||||
// populateCache/populateCacheForAllAccounts to use identityManager to get the list of
|
||||
// accounts
|
||||
- assert identityManager != null;
|
||||
mContext = context;
|
||||
mImageSize = imageSize;
|
||||
mDefaultBadgeConfig = badgeConfig;
|
||||
diff --git a/chrome/browser/ui/android/native_page/BUILD.gn b/chrome/browser/ui/android/native_page/BUILD.gn
|
||||
--- a/chrome/browser/ui/android/native_page/BUILD.gn
|
||||
+++ b/chrome/browser/ui/android/native_page/BUILD.gn
|
||||
|
||||
Reference in New Issue
Block a user