| Index: chrome/browser/browsing_data/chrome_browsing_data_types.cc
|
| diff --git a/chrome/browser/browsing_data/chrome_browsing_data_types.cc b/chrome/browser/browsing_data/chrome_browsing_data_types.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2d0a690ad02400f83d0c613adc8a6f1f9a6ed7e2
|
| --- /dev/null
|
| +++ b/chrome/browser/browsing_data/chrome_browsing_data_types.cc
|
| @@ -0,0 +1,115 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/browsing_data/chrome_browsing_data_types.h"
|
| +
|
| +#include <set>
|
| +
|
| +#include "base/lazy_instance.h"
|
| +#include "build/build_config.h"
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +// Chrome-specific datatypes.
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeHistory{"history", false};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeFormData{"form data", false};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypePasswords{"passwords", true};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypePluginData{"plugin data",
|
| + true};
|
| +
|
| +#if defined(OS_ANDROID)
|
| +const content::BrowsingDataType kBrowsingDataTypeWebAppData{"webapp data",
|
| + true};
|
| +#endif
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeSiteUsageData{
|
| + "site usage data", true};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeDurablePermission{
|
| + "durable permission", true};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeExternalProtocolData{
|
| + "external protocol data", true};
|
| +
|
| +const content::BrowsingDataType kBrowsingDataTypeHostedAppDataTestOnly{
|
| + "hosted app data (test only)", true};
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +// Group datatypes.
|
| +
|
| +namespace {
|
| +
|
| +class GroupDataTypes {
|
| + public:
|
| + GroupDataTypes() {
|
| + // SiteData
|
| + site_data = {
|
| + &kBrowsingDataTypeAppCache,
|
| + &kBrowsingDataTypeCookies,
|
| + &kBrowsingDataTypeFileSystems,
|
| + &kBrowsingDataTypeIndexedDB,
|
| + &kBrowsingDataTypeLocalStorage,
|
| + &kBrowsingDataTypePluginData,
|
| + &kBrowsingDataTypeServiceWorkers,
|
| + &kBrowsingDataTypeCacheStorage,
|
| + &kBrowsingDataTypeWebSQL,
|
| + &kBrowsingDataTypeChannelIDs,
|
| +#if defined(OS_ANDROID)
|
| + &kBrowsingDataTypeWebAppData,
|
| +#endif
|
| + &kBrowsingDataTypeSiteUsageData,
|
| + &kBrowsingDataTypeDurablePermission,
|
| + &kBrowsingDataTypeExternalProtocolData,
|
| + };
|
| +
|
| + // ImportantSites
|
| + important_sites = site_data;
|
| + important_sites.insert(&kBrowsingDataTypeCache);
|
| +
|
| + // All
|
| + all = important_sites;
|
| + all.insert(&kBrowsingDataTypeDownloads);
|
| + all.insert(&kBrowsingDataTypeFormData);
|
| + all.insert(&kBrowsingDataTypeHistory);
|
| + all.insert(&kBrowsingDataTypePasswords);
|
| +
|
| + // WipeProfile
|
| + wipe_profile = all;
|
| + wipe_profile.insert(&kBrowsingDataTypeNoChecks);
|
| + }
|
| +
|
| + ~GroupDataTypes() {}
|
| +
|
| + std::set<const content::BrowsingDataType*> site_data;
|
| + std::set<const content::BrowsingDataType*> important_sites;
|
| + std::set<const content::BrowsingDataType*> all;
|
| + std::set<const content::BrowsingDataType*> wipe_profile;
|
| +};
|
| +
|
| +static base::LazyInstance<GroupDataTypes>::Leaky g_group_data_types =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +} // namespace
|
| +
|
| +const std::set<const content::BrowsingDataType*>&
|
| +BrowsingDataTypeSetSiteData() {
|
| + return g_group_data_types.Get().site_data;
|
| +}
|
| +
|
| +const std::set<const content::BrowsingDataType*>&
|
| +BrowsingDataTypeSetImportantSites() {
|
| + return g_group_data_types.Get().important_sites;
|
| +}
|
| +
|
| +const std::set<const content::BrowsingDataType*>& BrowsingDataTypeSetAll() {
|
| + return g_group_data_types.Get().all;
|
| +}
|
| +
|
| +const std::set<const content::BrowsingDataType*>&
|
| +BrowsingDataTypeSetWipeProfile() {
|
| + return g_group_data_types.Get().wipe_profile;
|
| +}
|
|
|