Add an always-incognito mode: fix the opening of the bookmarks page (#1813)
This commit is contained in:
@@ -52,6 +52,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
.../chrome_autocomplete_provider_client.cc | 9 +
|
||||
.../chrome_autocomplete_provider_client.h | 1 +
|
||||
.../remote_suggestions_service_factory.cc | 5 +
|
||||
.../bookmarks/android/bookmark_bridge.cc | 7 +
|
||||
.../host_content_settings_map_factory.cc | 22 ++-
|
||||
chrome/browser/history/history_tab_helper.cc | 20 +++
|
||||
chrome/browser/history/history_tab_helper.h | 10 +-
|
||||
@@ -84,7 +85,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 +
|
||||
65 files changed, 784 insertions(+), 112 deletions(-)
|
||||
66 files changed, 791 insertions(+), 112 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
|
||||
@@ -1315,6 +1316,30 @@ diff --git a/chrome/browser/autocomplete/remote_suggestions_service_factory.cc b
|
||||
// TODO(crbug.com/41488885): Check if this service is needed for
|
||||
// Ash Internals.
|
||||
.WithAshInternals(ProfileSelection::kOriginalOnly)
|
||||
diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
--- a/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
+++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/uuid.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
||||
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
|
||||
#include "chrome/browser/commerce/shopping_service_factory.h"
|
||||
@@ -247,6 +248,12 @@ ScopedJavaLocalRef<jobject> JNI_BookmarkBridge_NativeGetForProfile(
|
||||
if (!profile)
|
||||
return nullptr;
|
||||
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+ if (profile->GetOriginalProfile()
|
||||
+ ->GetPrefs()->GetBoolean(prefs::kAlwaysIncognitoEnabled)) {
|
||||
+ profile = profile->GetOriginalProfile();
|
||||
+ }
|
||||
+#endif
|
||||
BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile);
|
||||
if (!model)
|
||||
return nullptr;
|
||||
diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
--- a/chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
+++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
|
||||
Reference in New Issue
Block a user