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

Unified Diff: chrome/browser/android/download/download_manager_service.cc

Issue 2314223003: [Download Home] Don't show canceled downloads (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/download/download_manager_service.cc
diff --git a/chrome/browser/android/download/download_manager_service.cc b/chrome/browser/android/download/download_manager_service.cc
index 3c7e9fba92f79feea815d84a86e9fedca2920cf0..d70f19c0ff10dc97b579e0222674df27db3700b2 100644
--- a/chrome/browser/android/download/download_manager_service.cc
+++ b/chrome/browser/android/download/download_manager_service.cc
@@ -238,9 +238,14 @@ void DownloadManagerService::OnHistoryQueryComplete() {
void DownloadManagerService::OnDownloadUpdated(
content::DownloadManager* manager, content::DownloadItem* item) {
+ if (java_ref_.is_null())
+ return;
+
// Ignore anything that isn't a completed download notification.
- if (!item->IsDone() || java_ref_.is_null())
+ if (!item->IsDone()
+ || item->GetState() != content::DownloadItem::DownloadState::COMPLETE) {
qinmin 2016/09/06 23:08:55 the 2nd condition implies the first one, you can r
gone 2016/09/06 23:24:05 Done.
return;
+ }
JNIEnv* env = base::android::AttachCurrentThread();
Java_DownloadManagerService_onDownloadItemUpdated(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698