| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BROWSING_DATA_SITE_DATA_COUNTING_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_SITE_DATA_COUNTING_HELPER_H_ |
| 7 |
| 8 #include <set> |
| 9 #include "components/content_settings/core/common/content_settings_types.h" |
| 10 #include "net/cookies/canonical_cookie.h" |
| 11 #include "net/ssl/channel_id_store.h" |
| 12 #include "storage/common/quota/quota_types.h" |
| 13 |
| 14 class Profile; |
| 15 class BrowsingDataFlashLSOHelper; |
| 16 class HostContentSettingsMap; |
| 17 |
| 18 namespace net { |
| 19 class URLRequestContextGetter; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 struct LocalStorageUsageInfo; |
| 24 struct SessionStorageUsageInfo; |
| 25 } |
| 26 |
| 27 namespace storage { |
| 28 class SpecialStoragePolicy; |
| 29 } |
| 30 |
| 31 // Helper class that counts the number of unique origins, that are affected by |
| 32 // deleting "cookies and site data" in the CBD dialog. |
| 33 class SiteDataCountingHelper { |
| 34 public: |
| 35 explicit SiteDataCountingHelper( |
| 36 Profile* profile, |
| 37 base::Time begin, |
| 38 base::Callback<void(int)> completion_callback); |
| 39 ~SiteDataCountingHelper(); |
| 40 |
| 41 void CountAndDestroySelfWhenFinished(); |
| 42 |
| 43 private: |
| 44 void GetOriginsFromHostContentSettignsMap(HostContentSettingsMap* hcsm, |
| 45 ContentSettingsType type); |
| 46 void GetCookiesOnIOThread( |
| 47 const scoped_refptr<net::URLRequestContextGetter>& rq_context); |
| 48 void GetCookiesCallback(const net::CookieList& cookies); |
| 49 void GetSessionStorageUsageInfoCallback( |
| 50 const scoped_refptr<storage::SpecialStoragePolicy>& |
| 51 special_storage_policy, |
| 52 const std::vector<content::SessionStorageUsageInfo>& infos); |
| 53 void GetLocalStorageUsageInfoCallback( |
| 54 const scoped_refptr<storage::SpecialStoragePolicy>& |
| 55 special_storage_policy, |
| 56 const std::vector<content::LocalStorageUsageInfo>& infos); |
| 57 void GetQuotaOriginsCallback(const std::set<GURL>& origin_set, |
| 58 storage::StorageType type); |
| 59 void SitesWithFlashDataCallback(const std::vector<std::string>& sites); |
| 60 void GetChannelIDsOnIOThread( |
| 61 const scoped_refptr<net::URLRequestContextGetter>& rq_context); |
| 62 void GetChannelIDsCallback( |
| 63 const net::ChannelIDStore::ChannelIDList& channel_ids); |
| 64 |
| 65 void Done(const std::vector<GURL>& origins); |
| 66 |
| 67 Profile* profile_; |
| 68 base::Time begin_; |
| 69 base::Callback<void(int)> completion_callback_; |
| 70 int tasks_; |
| 71 std::set<GURL> unique_origins_; |
| 72 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper_; |
| 73 }; |
| 74 |
| 75 #endif // CHROME_BROWSER_BROWSING_DATA_SITE_DATA_COUNTING_HELPER_H_ |
| OLD | NEW |