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

Side by Side Diff: chrome/browser/google_apis/drive_api_service.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/google_apis/drive_api_service.h" 5 #include "chrome/browser/google_apis/drive_api_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 url_request_context_getter_, 426 url_request_context_getter_,
427 url_generator_, 427 url_generator_,
428 base::Bind(&ParseAppListAndRun, callback))); 428 base::Bind(&ParseAppListAndRun, callback)));
429 } 429 }
430 430
431 void DriveAPIService::DownloadFile( 431 void DriveAPIService::DownloadFile(
432 const base::FilePath& virtual_path, 432 const base::FilePath& virtual_path,
433 const base::FilePath& local_cache_path, 433 const base::FilePath& local_cache_path,
434 const GURL& download_url, 434 const GURL& download_url,
435 const DownloadActionCallback& download_action_callback, 435 const DownloadActionCallback& download_action_callback,
436 const GetContentCallback& get_content_callback) { 436 const GetContentCallback& get_content_callback,
437 const ProgressCallback& progress_callback) {
437 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 438 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
438 DCHECK(!download_action_callback.is_null()); 439 DCHECK(!download_action_callback.is_null());
439 // get_content_callback may be null. 440 // get_content_callback may be null.
440 441
441 runner_->StartOperationWithRetry( 442 runner_->StartOperationWithRetry(
442 new DownloadFileOperation(operation_registry(), 443 new DownloadFileOperation(operation_registry(),
443 url_request_context_getter_, 444 url_request_context_getter_,
444 download_action_callback, 445 download_action_callback,
445 get_content_callback, 446 get_content_callback,
447 progress_callback,
446 download_url, 448 download_url,
447 virtual_path, 449 virtual_path,
448 local_cache_path)); 450 local_cache_path));
449 } 451 }
450 452
451 void DriveAPIService::DeleteResource( 453 void DriveAPIService::DeleteResource(
452 const std::string& resource_id, 454 const std::string& resource_id,
453 const std::string& etag, 455 const std::string& etag,
454 const EntryActionCallback& callback) { 456 const EntryActionCallback& callback) {
455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 457 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 } 699 }
698 700
699 void DriveAPIService::OnProgressUpdate( 701 void DriveAPIService::OnProgressUpdate(
700 const OperationProgressStatusList& list) { 702 const OperationProgressStatusList& list) {
701 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 703 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
702 FOR_EACH_OBSERVER( 704 FOR_EACH_OBSERVER(
703 DriveServiceObserver, observers_, OnProgressUpdate(list)); 705 DriveServiceObserver, observers_, OnProgressUpdate(list));
704 } 706 }
705 707
706 } // namespace google_apis 708 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/drive_api_service.h ('k') | chrome/browser/google_apis/drive_service_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698