diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 03db3381..be4a6b4a 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -145,7 +145,8 @@ Block-gateway-attacks-via-websockets.patch Enable-prefetch-privacy-changes-by-default.patch Enable-reduced-referrer-granularity-by-default.patch Restore-duet-flags.patch -Session-only-cookies-support.patch Disable-support-for-RAR-files-inspection.patch Enable-improved-cookie-controls-by-default.patch +Session-only-cookies-support.patch +Add-history-support-in-incognito-mode.patch Automated-domain-substitution.patch diff --git a/build/patches/Add-history-support-in-incognito-mode.patch b/build/patches/Add-history-support-in-incognito-mode.patch new file mode 100644 index 00000000..d20e346d --- /dev/null +++ b/build/patches/Add-history-support-in-incognito-mode.patch @@ -0,0 +1,273 @@ +From: uazo +Date: Fri, 7 Aug 2020 16:33:47 +0000 +Subject: Add history support in incognito mode + +--- + .../java/res/xml/privacy_preferences.xml | 5 +++++ + .../privacy/settings/PrivacySettings.java | 18 ++++++++++++++++++ + chrome/browser/android/preferences/prefs.h | 2 ++ + chrome/browser/history/history_tab_helper.cc | 16 ++++++++++++++++ + chrome/browser/history/history_tab_helper.h | 4 ++++ + chrome/browser/prefs/browser_prefs.cc | 2 ++ + .../android/strings/android_chrome_strings.grd | 6 ++++++ + .../translations/android_chrome_strings_it.xtb | 2 ++ + chrome/common/pref_names.cc | 5 +++++ + chrome/common/pref_names.h | 4 ++++ + 10 files changed, 64 insertions(+) + mode change 100644 => 100755 chrome/android/java/res/xml/privacy_preferences.xml + mode change 100644 => 100755 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java + mode change 100644 => 100755 chrome/browser/android/preferences/prefs.h + mode change 100644 => 100755 chrome/browser/history/history_tab_helper.cc + mode change 100644 => 100755 chrome/browser/history/history_tab_helper.h + mode change 100644 => 100755 chrome/browser/prefs/browser_prefs.cc + mode change 100644 => 100755 chrome/browser/ui/android/strings/android_chrome_strings.grd + mode change 100644 => 100755 chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb + mode change 100644 => 100755 chrome/common/pref_names.cc + mode change 100644 => 100755 chrome/common/pref_names.h + +diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml +old mode 100644 +new mode 100755 +--- a/chrome/android/java/res/xml/privacy_preferences.xml ++++ b/chrome/android/java/res/xml/privacy_preferences.xml +@@ -34,6 +34,11 @@ + android:title="@string/always_incognito_title" + android:summary="@string/always_incognito_summary" + android:defaultValue="false" /> ++ + GetBrowserContext()); ++ ++#if defined(OS_ANDROID) ++ if(profile->GetOriginalProfile()->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled)) { ++ return HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS); ++ } ++#endif ++ + if (profile->IsOffTheRecord()) + return NULL; + +@@ -247,6 +257,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { + profile, ServiceAccessType::IMPLICIT_ACCESS); + } + ++// static ++void HistoryTabHelper::RegisterProfilePrefs(PrefRegistrySimple* registry) { ++ registry->RegisterBooleanPref(prefs::kIncognitoTabHistoryEnabled, ++ /*default_value=*/false); ++} ++ + void HistoryTabHelper::WebContentsDestroyed() { + // We update the history for this URL. + WebContents* tab = web_contents(); +diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h +old mode 100644 +new mode 100755 +--- a/chrome/browser/history/history_tab_helper.h ++++ b/chrome/browser/history/history_tab_helper.h +@@ -10,6 +10,8 @@ + #include "base/time/time.h" + #include "content/public/browser/web_contents_observer.h" + #include "content/public/browser/web_contents_user_data.h" ++#include "components/prefs/pref_registry_simple.h" ++#include "components/prefs/pref_service.h" + + namespace history { + struct HistoryAddPageArgs; +@@ -34,6 +36,8 @@ class HistoryTabHelper : public content::WebContentsObserver, + int nav_entry_id, + content::NavigationHandle* navigation_handle); + ++ static void RegisterProfilePrefs(PrefRegistrySimple* registry); ++ + private: + explicit HistoryTabHelper(content::WebContents* web_contents); + friend class content::WebContentsUserData; +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +old mode 100644 +new mode 100755 +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -232,6 +232,7 @@ + #include "components/ntp_tiles/popular_sites_impl.h" + #include "components/permissions/contexts/geolocation_permission_context_android.h" + #include "components/query_tiles/tile_service_prefs.h" ++#include "chrome/browser/history/history_tab_helper.h" + #if BUILDFLAG(ENABLE_FEED_IN_CHROME) + #include "components/feed/core/common/pref_names.h" + #endif // BUILDFLAG(ENABLE_FEED_IN_CHROME) +@@ -978,6 +979,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry); + variations::VariationsService::RegisterProfilePrefs(registry); + feed::prefs::RegisterFeedSharedProfilePrefs(registry); ++ HistoryTabHelper::RegisterProfilePrefs(registry); + #if BUILDFLAG(ENABLE_FEED_IN_CHROME) + feed::RegisterProfilePrefs(registry); + #endif // BUILDFLAG(ENABLE_FEED_IN_CHROME) +diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd +old mode 100644 +new mode 100755 +--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd ++++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd +@@ -746,6 +746,12 @@ Your Google account may have other forms of browsing history like searches and a + + Opens links in incognito tabs when you click on new tab or on a link + ++ ++ Enable history in incognito tabs ++ ++ ++ Record history even in incognito mode ++ + + Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <link>myactivity.google.com</link>. + +diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb +old mode 100644 +new mode 100755 +--- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb ++++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb +@@ -1011,4 +1011,6 @@ Ad esempio, alcuni siti web potrebbero rispondere alla richiesta mostrando annun + Utilizza un servizio di previsione per visualizzare query correlate e siti web popolari durante la digitazione nella barra degli indirizzi + Sincronizzazione con + Gestione attività di Google ++Abilita la cronologia nelle sessioni in incognito ++Abilita la registrazione della navigazione nella cronologia anche per le sessioni in incognito + +diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc +old mode 100644 +new mode 100755 +--- a/chrome/common/pref_names.cc ++++ b/chrome/common/pref_names.cc +@@ -2996,4 +2996,9 @@ const char kMediaFeedsSafeSearchEnabled[] = "media_feeds_safe_search_enabled"; + // TODO(enne): Remove this once AppCache has been removed. + const char kAppCacheForceEnabled[] = "app_cache_force_enabled"; + ++#if defined(OS_ANDROID) ++const char kIncognitoTabHistoryEnabled[] = ++ "incognito_tab_history_enabled"; ++#endif ++ + } // namespace prefs +diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h +old mode 100644 +new mode 100755 +--- a/chrome/common/pref_names.h ++++ b/chrome/common/pref_names.h +@@ -1064,6 +1064,10 @@ extern const char kMediaFeedsSafeSearchEnabled[]; + + extern const char kAppCacheForceEnabled[]; + ++#if defined(OS_ANDROID) ++extern const char kIncognitoTabHistoryEnabled[]; ++#endif ++ + } // namespace prefs + + #endif // CHROME_COMMON_PREF_NAMES_H_ +-- +2.17.1 +