diff options
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch deleted file mode 100644 index 070c4cd..0000000 --- a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch +++ /dev/null | |||
| @@ -1,97 +0,0 @@ | |||
| 1 | --- chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager.cc.orig | ||
| 2 | +++ chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager.cc | ||
| 3 | @@ -24,6 +24,7 @@ | ||
| 4 | #include "chrome/browser/profiles/profile.h" | ||
| 5 | #include "chrome/browser/profiles/profile_manager.h" | ||
| 6 | #include "chrome/browser/sync/sync_service_factory.h" | ||
| 7 | +#include "components/browsing_data/core/features.h" | ||
| 8 | #include "components/browsing_data/core/pref_names.h" | ||
| 9 | #include "components/keep_alive_registry/keep_alive_types.h" | ||
| 10 | #include "components/keep_alive_registry/scoped_keep_alive.h" | ||
| 11 | @@ -151,6 +152,21 @@ class BrowsingDataRemoverObserver | ||
| 12 | #endif | ||
| 13 | }; | ||
| 14 | |||
| 15 | +uint64_t AllOriginTypeMask() { | ||
| 16 | + return content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB | | ||
| 17 | + content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +uint64_t AllRemoveMask() { | ||
| 21 | + return content::BrowsingDataRemover::DATA_TYPE_CACHE | | ||
| 22 | + content::BrowsingDataRemover::DATA_TYPE_DOWNLOADS | | ||
| 23 | + chrome_browsing_data_remover::DATA_TYPE_CONTENT_SETTINGS | | ||
| 24 | + chrome_browsing_data_remover::DATA_TYPE_FORM_DATA | | ||
| 25 | + chrome_browsing_data_remover::DATA_TYPE_HISTORY | | ||
| 26 | + chrome_browsing_data_remover::DATA_TYPE_PASSWORDS | | ||
| 27 | + chrome_browsing_data_remover::DATA_TYPE_SITE_DATA; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | uint64_t GetOriginTypeMask(const base::Value& data_types) { | ||
| 31 | uint64_t result = 0; | ||
| 32 | for (const auto& data_type : data_types.GetList()) { | ||
| 33 | @@ -292,8 +308,9 @@ void ChromeBrowsingDataLifetimeManager:: | ||
| 34 | bool keep_browser_alive) { | ||
| 35 | auto* data_types = profile_->GetPrefs()->GetList( | ||
| 36 | browsing_data::prefs::kClearBrowsingDataOnExitList); | ||
| 37 | - if (data_types && !data_types->GetList().empty() && | ||
| 38 | - !SyncServiceFactory::IsSyncAllowed(profile_)) { | ||
| 39 | + bool cdoe = base::FeatureList::IsEnabled(browsing_data::features::kClearDataOnExit); | ||
| 40 | + if (cdoe || (data_types && !data_types->GetList().empty() && | ||
| 41 | + !SyncServiceFactory::IsSyncAllowed(profile_))) { | ||
| 42 | profile_->GetPrefs()->SetBoolean( | ||
| 43 | browsing_data::prefs::kClearBrowsingDataOnExitDeletionPending, true); | ||
| 44 | auto* remover = profile_->GetBrowsingDataRemover(); | ||
| 45 | @@ -304,8 +321,8 @@ void ChromeBrowsingDataLifetimeManager:: | ||
| 46 | DCHECK(keep_browser_alive); | ||
| 47 | #endif | ||
| 48 | remover->RemoveAndReply(base::Time(), base::Time::Max(), | ||
| 49 | - GetRemoveMask(*data_types), | ||
| 50 | - GetOriginTypeMask(*data_types), | ||
| 51 | + cdoe ? AllRemoveMask() : GetRemoveMask(*data_types), | ||
| 52 | + cdoe ? AllOriginTypeMask() : GetOriginTypeMask(*data_types), | ||
| 53 | BrowsingDataRemoverObserver::Create( | ||
| 54 | remover, /*filterable_deletion=*/true, profile_, | ||
| 55 | keep_browser_alive)); | ||
| 56 | --- chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager_factory.cc.orig | ||
| 57 | +++ chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager_factory.cc | ||
| 58 | @@ -48,6 +48,8 @@ ChromeBrowsingDataLifetimeManagerFactory | ||
| 59 | KeyedService* ChromeBrowsingDataLifetimeManagerFactory::BuildServiceInstanceFor( | ||
| 60 | content::BrowserContext* context) const { | ||
| 61 | if (!base::FeatureList::IsEnabled( | ||
| 62 | + browsing_data::features::kClearDataOnExit) && | ||
| 63 | + !base::FeatureList::IsEnabled( | ||
| 64 | browsing_data::features::kEnableBrowsingDataLifetimeManager)) | ||
| 65 | return nullptr; | ||
| 66 | Profile* profile = Profile::FromBrowserContext(context); | ||
| 67 | --- chrome/browser/ungoogled_flag_entries.h.orig | ||
| 68 | +++ chrome/browser/ungoogled_flag_entries.h | ||
| 69 | @@ -64,4 +64,8 @@ | ||
| 70 | "Keep old history", | ||
| 71 | "Keep history older than 3 months. ungoogled-chromium flag", | ||
| 72 | kOsAll, SINGLE_VALUE_TYPE("keep-old-history")}, | ||
| 73 | + {"clear-data-on-exit", | ||
| 74 | + "Clear data on exit", | ||
| 75 | + "Clears all browsing data on exit. ungoogled-chromium flag", | ||
| 76 | + kOsDesktop, FEATURE_VALUE_TYPE(browsing_data::features::kClearDataOnExit)}, | ||
| 77 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ | ||
| 78 | --- components/browsing_data/core/features.cc.orig | ||
| 79 | +++ components/browsing_data/core/features.cc | ||
| 80 | @@ -19,5 +19,7 @@ const base::Feature kEnableBrowsingDataL | ||
| 81 | const base::Feature kEnableBrowsingDataLifetimeManager{ | ||
| 82 | "BrowsingDataLifetimeManager", base::FEATURE_ENABLED_BY_DEFAULT}; | ||
| 83 | #endif | ||
| 84 | + | ||
| 85 | +const base::Feature kClearDataOnExit{"ClearDataOnExit", base::FEATURE_DISABLED_BY_DEFAULT}; | ||
| 86 | } // namespace features | ||
| 87 | } // namespace browsing_data | ||
| 88 | --- components/browsing_data/core/features.h.orig | ||
| 89 | +++ components/browsing_data/core/features.h | ||
| 90 | @@ -17,6 +17,7 @@ extern const base::Feature kEnableRemovi | ||
| 91 | // defined by the BrowsingDataLifetime policy. | ||
| 92 | extern const base::Feature kEnableBrowsingDataLifetimeManager; | ||
| 93 | |||
| 94 | +extern const base::Feature kClearDataOnExit; | ||
| 95 | } // namespace features | ||
| 96 | } // namespace browsing_data | ||
| 97 | |||
