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

Unified Diff: chrome/browser/chromeos/gdata/drive_download_observer.cc

Issue 10913015: Reland DownloadManager::GetAllDownloads actually does now (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
Index: chrome/browser/chromeos/gdata/drive_download_observer.cc
diff --git a/chrome/browser/chromeos/gdata/drive_download_observer.cc b/chrome/browser/chromeos/gdata/drive_download_observer.cc
index b13fac055cbe9ac600891f5c1f5ffe2fbcbcb3d6..79e451b5ecf823b472f6de20bd05f6c36699f8ad 100644
--- a/chrome/browser/chromeos/gdata/drive_download_observer.cc
+++ b/chrome/browser/chromeos/gdata/drive_download_observer.cc
@@ -351,13 +351,15 @@ void DriveDownloadObserver::ModelChanged(DownloadManager* download_manager) {
DownloadManager::DownloadVector downloads;
// Drive downloads are considered temporary downloads.
- download_manager->GetTemporaryDownloads(drive_tmp_download_path_,
- &downloads);
+ download_manager->GetAllDownloads(&downloads);
for (size_t i = 0; i < downloads.size(); ++i) {
// Only accept downloads that have the Drive meta data associated with
// them. Otherwise we might trip over non-Drive downloads being saved to
// drive_tmp_download_path_.
- if (IsDriveDownload(downloads[i]))
+ if (downloads[i]->IsTemporary() &&
+ (downloads[i]->GetTargetFilePath().DirName() ==
+ drive_tmp_download_path_) &&
+ IsDriveDownload(downloads[i]))
OnDownloadUpdated(downloads[i]);
}
}
@@ -456,9 +458,11 @@ bool DriveDownloadObserver::ShouldUpload(DownloadItem* download) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Upload if the item is in pending_downloads_,
+ // has a filename,
// is complete or large enough to stream, and,
// is not already being uploaded.
return (pending_downloads_.count(download->GetId()) != 0) &&
+ !download->GetFullPath().empty() &&
(download->AllDataSaved() ||
download->GetReceivedBytes() > kStreamingFileSize) &&
(GetUploadingUserData(download) == NULL);
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_browsertest.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698