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

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: Merge with the latest revision Created 9 years, 6 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/download/download_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_item.h
diff --git a/chrome/browser/download/download_item.h b/chrome/browser/download/download_item.h
index ef262d61073cd25ab47b8c781b0c46b32ac04f4e..9e501f29066ab044f1e85a9604450c06680065ad 100644
--- a/chrome/browser/download/download_item.h
+++ b/chrome/browser/download/download_item.h
@@ -135,7 +135,11 @@ class DownloadItem : public NotificationObserver {
const NotificationSource& source,
const NotificationDetails& details);
- // Returns true if it is OK to open this download.
+ // Returns true if it is OK to open a folder which this file is inside.
+ bool CanShowInFolder();
+
+ // Returns true if it is OK to register the type of this file so that
+ // it opens automatically.
bool CanOpenDownload();
// Tests if a file type should be opened automatically.
@@ -170,13 +174,16 @@ class DownloadItem : public NotificationObserver {
// 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.
@@ -278,6 +285,7 @@ class DownloadItem : public NotificationObserver {
bool is_paused() const { return is_paused_; }
bool open_when_complete() const { return open_when_complete_; }
void set_open_when_complete(bool open) { open_when_complete_ = open; }
+ bool file_externally_removed() const { return file_externally_removed_; }
SafetyState safety_state() const { return safety_state_; }
void set_safety_state(SafetyState safety_state) {
safety_state_ = safety_state;
@@ -432,6 +440,9 @@ class DownloadItem : public NotificationObserver {
// A flag for indicating if the download should be opened at completion.
bool open_when_complete_;
+ // A flag for indicating if the downloaded file is externally removed.
+ bool file_externally_removed_;
+
// Indicates if the download is considered potentially safe or dangerous
// (executable files are typically considered dangerous).
SafetyState safety_state_;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698