Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1367063004: Support undoing offline page deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Filip's feedback Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 648a0f4002758696ef7cafbc70a3291bf15c0b16..c8cd1446814c86c12b9d00df3d53214e79372608 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -135,6 +135,12 @@ class OfflinePageModel : public KeyedService,
// will be updated. Requires that the model is loaded.
void MarkPageAccessed(int64 bookmark_id);
+ // Marks that the offline page related to the passed |bookmark_id| was going
+ // to be deleted. The deletion will occur in a short while. The undo can be
+ // done before this. Requires that the model is loaded.
+ void MarkPageForDeletion(int64 bookmark_id,
+ const DeletePageCallback& callback);
+
// Deletes an offline page related to the passed |bookmark_id|. Requires that
// the model is loaded.
void DeletePageByBookmarkId(int64 bookmark_id,
@@ -145,6 +151,9 @@ class OfflinePageModel : public KeyedService,
void DeletePagesByBookmarkId(const std::vector<int64>& bookmark_ids,
const DeletePageCallback& callback);
+ void UndeletePage(int64 bookmark_id,
+ const DeletePageCallback& callback);
+
// Gets all available offline pages. Requires that the model is loaded.
const std::vector<OfflinePageItem> GetAllPages() const;
@@ -175,6 +184,9 @@ class OfflinePageModel : public KeyedService,
int old_index,
const bookmarks::BookmarkNode* node,
const std::set<GURL>& removed_urls) override;
+ void BookmarkNodeRenumbered(bookmarks::BookmarkModel* model,
+ int64 old_bookmark_id,
fgorski 2015/09/25 21:23:57 fix types of bookmark_id to int64_t
jianli 2015/10/09 23:26:26 This is not longer needed.
+ int64 new_bookmark_id) override;
// Callback for loading pages from the offline page metadata store.
void OnLoadDone(bool success,
@@ -208,8 +220,16 @@ class OfflinePageModel : public KeyedService,
void InformDeletePageDone(const DeletePageCallback& callback,
DeletePageResult result);
- void OnUpdateOfflinePageDone(const OfflinePageItem& offline_page_item,
- bool success);
+ void OnMarkPageAccesseDone(const OfflinePageItem& offline_page_item,
+ bool success);
+
+ void OnMarkPageForDeletionDone(const OfflinePageItem& offline_page_item,
+ const DeletePageCallback& callback,
+ bool success);
+ void OnUndoOfflinePageDone(const OfflinePageItem& offline_page,
+ int64 old_bookmark_id,
+ bool success);
+ void FinalizePageDeletion();
// Persistent store for offline page metadata.
scoped_ptr<OfflinePageMetadataStore> store_;

Powered by Google App Engine
This is Rietveld 408576698