Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / drive_uploader_wrapper.cc
blob70fcbf135f31f1b103ef5f386b816aef5ee71e5a
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.
5 #include "chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h"
7 #include "base/memory/weak_ptr.h"
8 #include "components/drive/drive_uploader.h"
10 namespace sync_file_system {
11 namespace drive_backend {
13 DriveUploaderWrapper::DriveUploaderWrapper(
14 drive::DriveUploaderInterface* drive_uploader)
15 : drive_uploader_(drive_uploader) {}
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::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());
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::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());
51 } // namespace drive_backend
52 } // namespace sync_file_system