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

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

Issue 3177034: Makes the download shelf auto-close after the user opens all downloads (Closed)
Patch Set: Have OnDownloadOpened invoked before opened to match old behavior Created 10 years, 4 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 | « no previous file | chrome/browser/download/download_item.cc » ('j') | chrome/browser/views/download_item_view.h » ('J')
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 c3a5bd676408167ad4efde668859c8de00007a2e..ed7c4f13d504ae31947958ec0833b77d3ac8291d 100644
--- a/chrome/browser/download/download_item.h
+++ b/chrome/browser/download/download_item.h
@@ -105,6 +105,10 @@ class DownloadItem {
// complete if it is in progress).
void OpenDownload();
+ // Callback from the DownloadManager when the item is opened. Sets opened_
+ // to true and notifies observers.
+ void Opened();
+
// Show the download via the OS shell.
void ShowDownloadInShell();
@@ -194,6 +198,8 @@ class DownloadItem {
void set_need_final_rename(bool need_final_rename) {
need_final_rename_ = need_final_rename;
}
+ void set_opened(bool opened) { opened_ = opened; }
+ bool opened() const { return opened_; }
// Returns the file-name that should be reported to the user, which is
// file_name_ for safe downloads and original_name_ for dangerous ones with
@@ -304,6 +310,12 @@ class DownloadItem {
// True if the file needs final rename.
bool need_final_rename_;
+ // Did the user open the item either directly or indirectly (such as by
+ // setting always open files of this type)? The shelf also sets this field
+ // when the user closes the shelf before the item has been opened but should
+ // be treated as though the user opened it.
+ bool opened_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadItem);
};
« no previous file with comments | « no previous file | chrome/browser/download/download_item.cc » ('j') | chrome/browser/views/download_item_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698