| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 const DeletePageCallback& callback); | 181 const DeletePageCallback& callback); |
| 182 | 182 |
| 183 // Deletes offline pages related to the passed |offline_ids|. Requires that | 183 // Deletes offline pages related to the passed |offline_ids|. Requires that |
| 184 // the model is loaded. | 184 // the model is loaded. |
| 185 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 185 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
| 186 const DeletePageCallback& callback); | 186 const DeletePageCallback& callback); |
| 187 | 187 |
| 188 // Wipes out all the data by deleting all saved files and clearing the store. | 188 // Wipes out all the data by deleting all saved files and clearing the store. |
| 189 void ClearAll(const base::Closure& callback); | 189 void ClearAll(const base::Closure& callback); |
| 190 | 190 |
| 191 // Wipes out data flagged by the predicate by deleting all saved files and |
| 192 // clearing the store. |
| 193 void ClearWithURLPredicate(const base::Callback<bool(const GURL&)> predicate, |
| 194 const base::Closure& callback); |
| 195 |
| 191 // Returns true if there're offline pages. | 196 // Returns true if there're offline pages. |
| 192 bool HasOfflinePages() const; | 197 bool HasOfflinePages() const; |
| 193 | 198 |
| 194 // Gets all available offline pages. Requires that the model is loaded. | 199 // Gets all available offline pages. Requires that the model is loaded. |
| 195 const std::vector<OfflinePageItem> GetAllPages() const; | 200 const std::vector<OfflinePageItem> GetAllPages() const; |
| 196 | 201 |
| 197 // Gets pages that should be removed to clean up storage. Requires that the | 202 // Gets pages that should be removed to clean up storage. Requires that the |
| 198 // model is loaded. | 203 // model is loaded. |
| 199 const std::vector<OfflinePageItem> GetPagesToCleanUp() const; | 204 const std::vector<OfflinePageItem> GetPagesToCleanUp() const; |
| 200 | 205 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 scoped_observer_; | 343 scoped_observer_; |
| 339 | 344 |
| 340 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; | 345 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; |
| 341 | 346 |
| 342 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); | 347 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); |
| 343 }; | 348 }; |
| 344 | 349 |
| 345 } // namespace offline_pages | 350 } // namespace offline_pages |
| 346 | 351 |
| 347 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 352 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |