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 65ebf678ea575d091ad2cf251a1ac5bd7f25fbbb..5c825b5ae6ec26a57de1fbc6727e0ff90a0ea42c 100644 |
--- a/chrome/browser/android/download/download_manager_service.cc |
+++ b/chrome/browser/android/download/download_manager_service.cc |
@@ -121,7 +121,8 @@ ScopedJavaLocalRef<jobject> DownloadManagerService::CreateJavaDownloadInfo( |
ConvertUTF8ToJavaString(env, original_url), |
ConvertUTF8ToJavaString(env, item->GetReferrerUrl().spec()), |
time_remaining_known ? time_delta.InMilliseconds() |
- : kUnknownRemainingTime); |
+ : kUnknownRemainingTime, |
+ item->GetLastAccessTime().ToJavaTime()); |
} |
static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { |
@@ -239,6 +240,21 @@ void DownloadManagerService::CheckForExternallyRemovedDownloads( |
manager->CheckForHistoryFilesRemoval(); |
} |
+void DownloadManagerService::UpdateLastAccessTime( |
+ JNIEnv* env, |
+ const JavaParamRef<jobject>& obj, |
+ const JavaParamRef<jstring>& jdownload_guid, |
+ bool is_off_the_record) { |
+ std::string download_guid = ConvertJavaStringToUTF8(env, jdownload_guid); |
+ content::DownloadManager* manager = GetDownloadManager(is_off_the_record); |
+ if (!manager) |
+ return; |
+ |
+ content::DownloadItem* item = manager->GetDownloadByGuid(download_guid); |
+ if (item) |
+ item->SetLastAccessTime(base::Time::Now()); |
+} |
+ |
void DownloadManagerService::CancelDownload( |
JNIEnv* env, |
jobject obj, |