| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/browsing_data/browsing_data_remover_delegate.h" | 12 #include "chrome/browser/browsing_data/browsing_data_remover_delegate.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class BrowsingDataFilterBuilder; | 16 class BrowsingDataFilterBuilder; |
| 16 } | 17 } |
| 17 | 18 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 19 // BrowsingDataRemover is responsible for removing data related to browsing: | 20 // BrowsingDataRemover is responsible for removing data related to browsing: |
| 20 // visits in url database, downloads, cookies ... | 21 // visits in url database, downloads, cookies ... |
| 21 // | 22 // |
| 22 // USAGE: | 23 // USAGE: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 // | 44 // |
| 44 // void OnBrowsingDataRemoverDone() { | 45 // void OnBrowsingDataRemoverDone() { |
| 45 // LOG(INFO) << "Cookies were deleted."; | 46 // LOG(INFO) << "Cookies were deleted."; |
| 46 // } | 47 // } |
| 47 // } | 48 // } |
| 48 // | 49 // |
| 49 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
| 50 // | 51 // |
| 51 // TODO(crbug.com/668114): BrowsingDataRemover does not currently support plugin | 52 // TODO(crbug.com/668114): BrowsingDataRemover does not currently support plugin |
| 52 // data deletion. Use PluginDataRemover instead. | 53 // data deletion. Use PluginDataRemover instead. |
| 53 class BrowsingDataRemover { | 54 class BrowsingDataRemover : public KeyedService { |
| 54 public: | 55 public: |
| 55 // Mask used for Remove. | 56 // Mask used for Remove. |
| 56 enum RemoveDataMask { | 57 enum RemoveDataMask { |
| 57 REMOVE_APPCACHE = 1 << 0, | 58 REMOVE_APPCACHE = 1 << 0, |
| 58 REMOVE_CACHE = 1 << 1, | 59 REMOVE_CACHE = 1 << 1, |
| 59 REMOVE_COOKIES = 1 << 2, | 60 REMOVE_COOKIES = 1 << 2, |
| 60 REMOVE_DOWNLOADS = 1 << 3, | 61 REMOVE_DOWNLOADS = 1 << 3, |
| 61 REMOVE_FILE_SYSTEMS = 1 << 4, | 62 REMOVE_FILE_SYSTEMS = 1 << 4, |
| 62 REMOVE_FORM_DATA = 1 << 5, | 63 REMOVE_FORM_DATA = 1 << 5, |
| 63 // In addition to visits, REMOVE_HISTORY removes keywords, last session and | 64 // In addition to visits, REMOVE_HISTORY removes keywords, last session and |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // consider returning them in OnBrowsingDataRemoverDone() callback. If not, | 206 // consider returning them in OnBrowsingDataRemoverDone() callback. If not, |
| 206 // consider simplifying this interface by removing these methods and changing | 207 // consider simplifying this interface by removing these methods and changing |
| 207 // the tests to record the parameters using GMock instead. | 208 // the tests to record the parameters using GMock instead. |
| 208 virtual const base::Time& GetLastUsedBeginTime() = 0; | 209 virtual const base::Time& GetLastUsedBeginTime() = 0; |
| 209 virtual const base::Time& GetLastUsedEndTime() = 0; | 210 virtual const base::Time& GetLastUsedEndTime() = 0; |
| 210 virtual int GetLastUsedRemovalMask() = 0; | 211 virtual int GetLastUsedRemovalMask() = 0; |
| 211 virtual int GetLastUsedOriginTypeMask() = 0; | 212 virtual int GetLastUsedOriginTypeMask() = 0; |
| 212 }; | 213 }; |
| 213 | 214 |
| 214 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 215 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |