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

Unified Diff: components/offline_pages/offline_page_item.h

Issue 1367063004: Support undoing offline page deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_item.h
diff --git a/components/offline_pages/offline_page_item.h b/components/offline_pages/offline_page_item.h
index 0ae4a8c21720bd26bd5127b3a0cfefd9e1c3e133..b0c0a8846da0283f1c7b7621a0ff7c437811eae4 100644
--- a/components/offline_pages/offline_page_item.h
+++ b/components/offline_pages/offline_page_item.h
@@ -18,6 +18,12 @@ namespace offline_pages {
// Metadata of the offline page.
struct OfflinePageItem {
public:
+ // Note that this should match with Flags enum in offline_pages.proto.
+ enum Flags {
+ NO_FLAG = 0,
+ MARKED_FOR_DELETION = 0x1,
+ };
+
OfflinePageItem();
OfflinePageItem(const GURL& url,
int64 bookmark_id,
@@ -33,6 +39,13 @@ struct OfflinePageItem {
// Gets a URL of the file under |file_path|.
GURL GetOfflineURL() const;
+ // Returns true if the page has been marked for deletion. This allows an undo
+ // in a short time period. After that, the marked page will be deleted.
+ bool IsMarkedForDeletion() const;
+
+ // Clears the mark for deletion.
+ void ClearMarkForDeletion();
+
// The URL of the page.
GURL url;
// The Bookmark ID related to the offline page.
@@ -49,6 +62,8 @@ struct OfflinePageItem {
base::Time last_access_time;
// Number of times that the offline archive has been accessed.
int access_count;
+ // Flags about the state and behavior of the offline page.
+ Flags flags;
};
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698