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

Unified Diff: chrome/browser/google_apis/base_operations.cc

Issue 14215003: Add ProgressCallback to DriveServiceInterface::DownloadFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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/google_apis/base_operations.cc
diff --git a/chrome/browser/google_apis/base_operations.cc b/chrome/browser/google_apis/base_operations.cc
index 6692a8a7736399c3e9c3f27997f74eeaf5eb13e4..d42004dd675261b6277b1129232735f733830544 100644
--- a/chrome/browser/google_apis/base_operations.cc
+++ b/chrome/browser/google_apis/base_operations.cc
@@ -655,6 +655,7 @@ DownloadFileOperation::DownloadFileOperation(
net::URLRequestContextGetter* url_request_context_getter,
const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback,
+ const ProgressCallback& progress_callback,
const GURL& download_url,
const base::FilePath& drive_file_path,
const base::FilePath& output_file_path)
@@ -664,6 +665,7 @@ DownloadFileOperation::DownloadFileOperation(
drive_file_path),
download_action_callback_(download_action_callback),
get_content_callback_(get_content_callback),
+ progress_callback_(progress_callback),
download_url_(download_url) {
DCHECK(!download_action_callback_.is_null());
// get_content_callback may be null.
@@ -686,6 +688,8 @@ void DownloadFileOperation::OnURLFetchDownloadProgress(const URLFetcher* source,
int64 current,
int64 total) {
NotifyProgress(current, total);
+ if (!progress_callback_.is_null())
+ progress_callback_.Run(current, total);
}
bool DownloadFileOperation::ShouldSendDownloadData() {
« no previous file with comments | « chrome/browser/google_apis/base_operations.h ('k') | chrome/browser/google_apis/base_operations_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698