1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h" 6 7 #include "base/memory/weak_ptr.h" 8 #include "chrome/browser/drive/drive_uploader.h" 9 10 namespace sync_file_system { 11 namespace drive_backend { 12 13 DriveUploaderWrapper::DriveUploaderWrapper( 14 drive::DriveUploaderInterface* drive_uploader) 15 : drive_uploader_(drive_uploader) {} 16 17 void DriveUploaderWrapper::UploadExistingFile( 18 const std::string& resource_id, 19 const base::FilePath& local_file_path, 20 const std::string& content_type, 21 const drive::DriveUploaderInterface::UploadExistingFileOptions& options, 22 const drive::UploadCompletionCallback& callback) { 23 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 24 drive_uploader_->UploadExistingFile( 25 resource_id, 26 local_file_path, 27 content_type, 28 options, 29 callback, 30 google_apis::ProgressCallback()); 31 } 32 33 void DriveUploaderWrapper::UploadNewFile( 34 const std::string& parent_resource_id, 35 const base::FilePath& local_file_path, 36 const std::string& title, 37 const std::string& content_type, 38 const drive::DriveUploaderInterface::UploadNewFileOptions& options, 39 const drive::UploadCompletionCallback& callback) { 40 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 41 drive_uploader_->UploadNewFile( 42 parent_resource_id, 43 local_file_path, 44 title, 45 content_type, 46 options, 47 callback, 48 google_apis::ProgressCallback()); 49 } 50 51 } // namespace drive_backend 52 } // namespace sync_file_system 53