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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const DeletePageCallback& callback); | 130 const DeletePageCallback& callback); |
131 | 131 |
132 // Deletes offline pages related to the passed |bookmark_ids|. Requires that | 132 // Deletes offline pages related to the passed |bookmark_ids|. Requires that |
133 // the model is loaded. | 133 // the model is loaded. |
134 void DeletePagesByBookmarkId(const std::vector<int64>& bookmark_ids, | 134 void DeletePagesByBookmarkId(const std::vector<int64>& bookmark_ids, |
135 const DeletePageCallback& callback); | 135 const DeletePageCallback& callback); |
136 | 136 |
137 // Gets all available offline pages. Requires that the model is loaded. | 137 // Gets all available offline pages. Requires that the model is loaded. |
138 const std::vector<OfflinePageItem> GetAllPages() const; | 138 const std::vector<OfflinePageItem> GetAllPages() const; |
139 | 139 |
| 140 // Gets pages that should be removed to clean up storage. Requires that the |
| 141 // model is loaded. |
| 142 const std::vector<OfflinePageItem> GetPagesToCleanUp() const; |
| 143 |
140 // Gets an offline page associated with a specified |bookmark_id|. Returns | 144 // Gets an offline page associated with a specified |bookmark_id|. Returns |
141 // true if a matching offline page exists, and |offline_page| will be updated | 145 // true if a matching offline page exists, and |offline_page| will be updated |
142 // with corresponding value, or false, if no offline page was found. | 146 // with corresponding value, or false, if no offline page was found. |
143 bool GetPageByBookmarkId(int64 bookmark_id, | 147 bool GetPageByBookmarkId(int64 bookmark_id, |
144 OfflinePageItem* offline_page) const; | 148 OfflinePageItem* offline_page) const; |
145 | 149 |
146 // Returns an offline page that is stored as |offline_url|. nullptr is | 150 // Returns an offline page that is stored as |offline_url|. nullptr is |
147 // returned if not found. | 151 // returned if not found. |
148 const OfflinePageItem* GetPageByOfflineURL(const GURL& offline_url) const; | 152 const OfflinePageItem* GetPageByOfflineURL(const GURL& offline_url) const; |
149 | 153 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 scoped_observer_; | 220 scoped_observer_; |
217 | 221 |
218 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; | 222 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; |
219 | 223 |
220 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); | 224 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); |
221 }; | 225 }; |
222 | 226 |
223 } // namespace offline_pages | 227 } // namespace offline_pages |
224 | 228 |
225 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 229 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
OLD | NEW |