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

Unified Diff: content/browser/download/download_item_impl.h

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 1 month 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: content/browser/download/download_item_impl.h
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h
index b6394f7469dc777805772add0fa46b4177995171..e301b56a56cd1197281f0d982461e687ae994673 100644
--- a/content/browser/download/download_item_impl.h
+++ b/content/browser/download/download_item_impl.h
@@ -97,6 +97,8 @@ class CONTENT_EXPORT DownloadItemImpl
void Pause() override;
void Resume() override;
void Cancel(bool user_cancel) override;
+ void MarkRemoved() override;
+ void UndoRemove() override;
void Remove() override;
void OpenDownload() override;
void ShowDownloadInShell() override;
@@ -281,6 +283,17 @@ class CONTENT_EXPORT DownloadItemImpl
// CANCELLED_INTERNAL On cancel.
RESUMING_INTERNAL,
+ // The user removed this download from history but can undo this action.
+ // Transitions from:
+ // CANCELLED_INTERNAL
+ // COMPLETE_INTERNAL
+ // INTERRUPTED_INTERNAL
+ // Transitions to:
+ // CANCELLED_INTERNAL
+ // COMPLETE_INTERNAL
+ // INTERRUPTED_INTERNAL
arv (Not doing code reviews) 2014/11/13 19:02:30 This comment is confusing.
+ REMOVED_INTERNAL,
+
MAX_DOWNLOAD_INTERNAL_STATE,
};
@@ -489,6 +502,9 @@ class CONTENT_EXPORT DownloadItemImpl
// The current state of this download.
DownloadInternalState state_;
+ // The previous state of this download (set in TransitionTo()).
+ DownloadInternalState prev_state_;
+
// Current danger type for the download.
DownloadDangerType danger_type_;

Powered by Google App Engine
This is Rietveld 408576698