Chromium Code Reviews| Index: chrome/browser/browsing_data/browsing_data_remover.h |
| diff --git a/chrome/browser/browsing_data/browsing_data_remover.h b/chrome/browser/browsing_data/browsing_data_remover.h |
| index 7ff741203547fea3fa39f751bd7542742b69419e..5c31af2f1e77dd2c3d883dd38eade6b1d9c8c4de 100644 |
| --- a/chrome/browser/browsing_data/browsing_data_remover.h |
| +++ b/chrome/browser/browsing_data/browsing_data_remover.h |
| @@ -9,6 +9,7 @@ |
| #include <set> |
| +#include "base/callback_forward.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| @@ -20,6 +21,8 @@ |
| #include "base/time/time.h" |
| #include "build/build_config.h" |
| #include "chrome/common/features.h" |
| +#include "components/content_settings/core/common/content_settings_pattern.h" |
| +#include "components/content_settings/core/common/content_settings_types.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| #include "components/prefs/pref_member.h" |
| #include "components/search_engines/template_url_service.h" |
| @@ -36,7 +39,9 @@ |
| #endif |
| class BrowsingDataRemoverFactory; |
| +class HostContentSettingsMap; |
| class IOThread; |
| +class OriginFilterBuilder; |
| class Profile; |
| namespace chrome_browser_net { |
| @@ -247,6 +252,15 @@ class BrowsingDataRemover : public KeyedService |
| int remove_mask, |
| int origin_type_mask); |
| + // Removes the specified items related to browsing for all origins that match |
| + // the provided |origin_type_mask| (see BrowsingDataHelper::OriginTypeMask). |
| + // The |origin_filter| is used as a final filter for clearing operations. |
| + // TODO(dmurph): Support all backends with filter (crbug.com/589586). |
|
msramek
2016/03/01 17:24:09
Please add a comment, best in capital letters, not
dmurph
2016/03/08 01:42:56
Done.
|
| + void RemoveWithFilter(const TimeRange& time_range, |
| + int remove_mask, |
| + int origin_type_mask, |
| + const OriginFilterBuilder& origin_filter); |
| + |
| void AddObserver(Observer* observer); |
| void RemoveObserver(Observer* observer); |
| @@ -254,6 +268,17 @@ class BrowsingDataRemover : public KeyedService |
| void OverrideStoragePartitionForTesting( |
| content::StoragePartition* storage_partition); |
| + // Clears all host-specific settings for one content type that satisfy the |
| + // given predicate. |
| + // |
| + // This should only be called on the UI thread. |
| + static void ClearSettingsForOneTypeWithPredicate( |
|
msramek
2016/03/01 17:24:09
This probably doesn't belong to the public interfa
dmurph
2016/03/08 01:42:56
I'll make it private, as I want to be able to test
|
| + HostContentSettingsMap* content_settings_map, |
| + ContentSettingsType content_type, |
| + const base::Callback< |
| + bool(const ContentSettingsPattern& primary_pattern, |
| + const ContentSettingsPattern& secondary_pattern)>& predicate); |
| + |
| private: |
| // The clear API needs to be able to toggle removing_ in order to test that |
| // only one BrowsingDataRemover instance can be called at a time. |
| @@ -300,14 +325,15 @@ class BrowsingDataRemover : public KeyedService |
| // Removes the specified items related to browsing for a specific host. If the |
| // provided |remove_url| is empty, data is removed for all origins; otherwise, |
| - // it is restricted by origin (where implemented yet). The |
| + // it is restricted by the origin filter origin (where implemented yet). The |
| // |origin_type_mask| parameter defines the set of origins from which data |
| // should be removed (protected, unprotected, or both). |
| // TODO(ttr314): Remove "(where implemented yet)" constraint above once |
| // crbug.com/113621 is done. |
| + // TODO(crbug.com/589586): Support all backends w/ origin filter. |
| void RemoveImpl(const TimeRange& time_range, |
| int remove_mask, |
| - const GURL& remove_url, |
| + const OriginFilterBuilder& origin_filter, |
| int origin_type_mask); |
| // Notifies observers and transitions to the idle state. |