Chromium Code Reviews| Index: components/offline_pages/offline_page_model.h |
| diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h |
| index 9458727939a4443faa48d59310d194c5a4b03b3f..59474e7ddf6740c933216ce3a1b9e439326bfcdb 100644 |
| --- a/components/offline_pages/offline_page_model.h |
| +++ b/components/offline_pages/offline_page_model.h |
| @@ -98,6 +98,8 @@ class OfflinePageModel : public KeyedService, |
| public: |
| // Invoked when the model has finished loading. |
| virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0; |
| + // Invoked when an offline copy related to |bookmark_id| was deleted. |
|
jianli
2015/10/20 21:56:49
nit: add blank line
Also please move this method
fgorski
2015/10/21 20:01:33
Done.
|
| + virtual void OfflinePageDeleted(int64 bookmark_id) = 0; |
| // Invoked when the model is being updated, due to adding, removing or |
| // updating an offline page. |
| @@ -169,10 +171,16 @@ class OfflinePageModel : public KeyedService, |
| // is returned if not found. |
| const OfflinePageItem* GetPageByBookmarkId(int64 bookmark_id) const; |
| - // Returns an offline page that is stored as |offline_url|. nullptr is |
| + // Returns an offline page that is stored as |offline_url|. A nullptr is |
| // returned if not found. |
| const OfflinePageItem* GetPageByOfflineURL(const GURL& offline_url) const; |
| + // Checks that all of the offline pages have corresponding offline copies. |
| + // If a page is discovered to be missing an offline copy, its offline page |
| + // metadata will be removed and |OfflinePageDeleted| will be sent to model |
| + // observers. |
| + void CheckForExternalFileDeletion(); |
| + |
| // Methods for testing only: |
| OfflinePageMetadataStore* GetStoreForTesting(); |
| @@ -229,16 +237,23 @@ class OfflinePageModel : public KeyedService, |
| void OnMarkPageAccesseDone(const OfflinePageItem& offline_page_item, |
| bool success); |
| - // Steps for marking an offline page for deletion that can be undo-ed. |
| + // Steps for marking an offline page for deletion that can be undone. |
| void OnMarkPageForDeletionDone(const OfflinePageItem& offline_page_item, |
| const DeletePageCallback& callback, |
| bool success); |
| void FinalizePageDeletion(); |
| - // Steps for undoing a offline page deletion. |
| + // Steps for undoing an offline page deletion. |
| void UndoPageDeletion(int64 bookmark_id); |
| void OnUndoOfflinePageDone(const OfflinePageItem& offline_page, bool success); |
| + // Callbacks for checking if offline pages are missing archive files. |
| + void OnListPagesMissingArchiveFileDone( |
| + const std::vector<int64>* pages_missing_archive_file); |
| + void OnRemovalOfPagesMissingArchiveFileDone( |
| + const std::vector<int64>& bookmark_ids, |
| + OfflinePageModel::DeletePageResult result); |
| + |
| // Persistent store for offline page metadata. |
| scoped_ptr<OfflinePageMetadataStore> store_; |