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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.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: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index bce81648e9dd7d2ff6e35be16cde7e780bacbfed..388ec3dd5b699d36a43f05e1405c6d361c14ce69 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -480,6 +480,7 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) {
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM);
+ DownloadItemModel(download).SetOpenedOrShown(true);
OpenDownloadUsingPlatformHandler(download);
return;
}
@@ -505,6 +506,7 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
browser->OpenURL(params);
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
+ DownloadItemModel(download).SetOpenedOrShown(true);
#else
// ShouldPreferOpeningInBrowser() should never be true on Android.
NOTREACHED();
@@ -518,6 +520,7 @@ void ChromeDownloadManagerDelegate::ShowDownloadInShell(
base::FilePath platform_path(
GetPlatformDownloadPath(profile_, download, PLATFORM_CURRENT_PATH));
DCHECK(!platform_path.empty());
+ DownloadItemModel(download).SetOpenedOrShown(true);
platform_util::ShowItemInFolder(profile_, platform_path);
}
« no previous file with comments | « chrome/browser/download/all_download_item_notifier_unittest.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698