63 lines
2.6 KiB
Diff
63 lines
2.6 KiB
Diff
From: Your Name <you@example.com>
|
|
Date: Wed, 12 Oct 2022 09:09:26 +0000
|
|
Subject: WIN ADDTO Add an always-incognito mode
|
|
|
|
---
|
|
.../browser/autocomplete/chrome_autocomplete_provider_client.cc | 2 ++
|
|
.../content_settings/host_content_settings_map_factory.cc | 2 ++
|
|
chrome/browser/history/history_tab_helper.cc | 2 ++
|
|
3 files changed, 6 insertions(+)
|
|
|
|
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
|
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
|
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
|
@@ -355,9 +355,11 @@ ChromeAutocompleteProviderClient::GetOnDeviceTailModelService() const {
|
|
}
|
|
|
|
bool ChromeAutocompleteProviderClient::IsAlwaysIncognitoEnabled() const {
|
|
+#if BUILDFLAG(IS_ANDROID)
|
|
if (profile_->GetPrefs()->GetBoolean(prefs::kAlwaysIncognitoEnabled)) {
|
|
return true;
|
|
}
|
|
+#endif
|
|
return false;
|
|
}
|
|
|
|
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
|
|
@@ -125,6 +125,7 @@ scoped_refptr<RefcountedKeyedService>
|
|
bool always_incognito_enabled = false;
|
|
bool force_save_site_settings = false;
|
|
|
|
+#if BUILDFLAG(IS_ANDROID)
|
|
PrefService* prefService = original_profile->GetPrefs();
|
|
if (prefService->GetBoolean(prefs::kAlwaysIncognitoEnabled)) {
|
|
always_incognito_enabled = true;
|
|
@@ -134,6 +135,7 @@ scoped_refptr<RefcountedKeyedService>
|
|
profile = original_profile;
|
|
force_save_site_settings = true;
|
|
}
|
|
+#endif
|
|
|
|
scoped_refptr<HostContentSettingsMap> settings_map(new HostContentSettingsMap(
|
|
profile->GetPrefs(),
|
|
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
|
|
--- a/chrome/browser/history/history_tab_helper.cc
|
|
+++ b/chrome/browser/history/history_tab_helper.cc
|
|
@@ -493,10 +493,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() {
|
|
|
|
// static
|
|
void HistoryTabHelper::RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
|
+#if BUILDFLAG(IS_ANDROID)
|
|
registry->RegisterBooleanPref(prefs::kIncognitoTabHistoryEnabled,
|
|
/*default_value=*/false);
|
|
registry->RegisterBooleanPref(prefs::kIncognitoSaveSiteSettingEnabled,
|
|
/*default_value=*/false);
|
|
+#endif
|
|
}
|
|
|
|
void HistoryTabHelper::WebContentsDestroyed() {
|
|
--
|
|
2.25.1
|