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

Unified Diff: chrome/browser/download/download_item.h

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct typo Created 9 years, 7 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: chrome/browser/download/download_item.h
diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h
index aafab618660ffba44e9cfa8be88381a38501bcf3..c4b9b492954741dee7e1ebea64c99189cdf8fb65 100644
--- a/chrome/browser/download/download_item.h
+++ b/chrome/browser/download/download_item.h
@@ -156,13 +156,16 @@ class DownloadItem {
// when resuming a download (assuming the server supports byte ranges).
void Cancel(bool update_history);
- // Called when all data has been saved. Only has display effects.
- void OnAllDataSaved(int64 size);
-
// Called by external code (SavePackage) using the DownloadItem interface
// to display progress when the DownloadItem should be considered complete.
void MarkAsComplete();
+ // Called when all data has been saved. Only has display effects.
+ void OnAllDataSaved(int64 size);
+
+ // Called when the downloaded file is removed.
+ void OnDownloadedFileRemoved();
+
// Download operation had an error.
// |size| is the amount of data received so far, and |os_error| is the error
// code that the operation received.
@@ -259,6 +262,7 @@ class DownloadItem {
void set_open_when_complete(bool open) { open_when_complete_ = open; }
int render_process_id() const { return render_process_id_; }
int request_id() const { return request_id_; }
+ bool file_exists() const { return file_exists_; }
SafetyState safety_state() const { return safety_state_; }
void set_safety_state(SafetyState safety_state) {
safety_state_ = safety_state;
@@ -365,6 +369,9 @@ class DownloadItem {
// A flag for indicating if the download should be opened at completion.
bool open_when_complete_;
+ // A flag for indicating if the downloaded file exists.
+ bool file_exists_;
Randy Smith (Not in Mondays) 2011/05/12 20:21:17 This flag is currently only valid after the state
Paweł Hajdan Jr. 2011/05/13 08:41:10 I prefer file_exists for simplicity. file_external
haraken1 2011/05/13 14:08:17 I also prefer |file_externally_removed_| in this c
Randy Smith (Not in Mondays) 2011/05/13 20:45:32 Sure, but having a race condition to watch for bet
+
// Whether the download is considered potentially safe or dangerous
// (executable files are typically considered dangerous).
SafetyState safety_state_;

Powered by Google App Engine
This is Rietveld 408576698