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

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

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. Created 4 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.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index f2494eb3fc479ad88b90c3c71d59901c646be2cd..5a00ce915a9152bbfe344bd020c872de2118e94b 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -430,15 +430,17 @@ void DownloadItemImpl::OpenDownload() {
delegate_->CheckForFileRemoval(this);
RecordOpen(GetEndTime(), !GetOpened());
opened_ = true;
- for (auto& observer : observers_)
- observer.OnDownloadOpened(this);
delegate_->OpenDownload(this);
+ for (auto& observer : observers_)
+ observer.OnDownloadOpened(this);
}
void DownloadItemImpl::ShowDownloadInShell() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
delegate_->ShowDownloadInShell(this);
+ for (auto& observer : observers_)
+ observer.OnDownloadShown(this);
}
uint32_t DownloadItemImpl::GetId() const {
@@ -773,10 +775,6 @@ void DownloadItemImpl::SetOpenWhenComplete(bool open) {
open_when_complete_ = open;
}
-void DownloadItemImpl::SetOpened(bool opened) {
- opened_ = opened;
-}
-
void DownloadItemImpl::SetDisplayName(const base::FilePath& name) {
display_name_ = name;
}
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698