| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync_file_system/drive_backend/api_util.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/api_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 } | 896 } |
| 897 | 897 |
| 898 std::string mime_type = GetMimeTypeFromTitle(entry->title()); | 898 std::string mime_type = GetMimeTypeFromTitle(entry->title()); |
| 899 UploadKey upload_key = RegisterUploadCallback(callback); | 899 UploadKey upload_key = RegisterUploadCallback(callback); |
| 900 ResourceEntryCallback did_upload_callback = | 900 ResourceEntryCallback did_upload_callback = |
| 901 base::Bind(&APIUtil::DidUploadExistingFile, AsWeakPtr(), upload_key); | 901 base::Bind(&APIUtil::DidUploadExistingFile, AsWeakPtr(), upload_key); |
| 902 drive_uploader_->UploadExistingFile( | 902 drive_uploader_->UploadExistingFile( |
| 903 entry->resource_id(), | 903 entry->resource_id(), |
| 904 local_file_path, | 904 local_file_path, |
| 905 mime_type, | 905 mime_type, |
| 906 entry->etag(), | 906 // Don't use etag for uploading for now. http://crbug.com/278201 |
| 907 std::string(), // entry->etag(), |
| 907 base::Bind(&UploadResultAdapter, did_upload_callback), | 908 base::Bind(&UploadResultAdapter, did_upload_callback), |
| 908 google_apis::ProgressCallback()); | 909 google_apis::ProgressCallback()); |
| 909 } | 910 } |
| 910 | 911 |
| 911 bool APIUtil::IsAuthenticated() const { | 912 bool APIUtil::IsAuthenticated() const { |
| 912 return drive_service_->HasRefreshToken(); | 913 return drive_service_->HasRefreshToken(); |
| 913 } | 914 } |
| 914 | 915 |
| 915 void APIUtil::DidUploadExistingFile( | 916 void APIUtil::DidUploadExistingFile( |
| 916 UploadKey upload_key, | 917 UploadKey upload_key, |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 } | 1133 } |
| 1133 | 1134 |
| 1134 std::string APIUtil::GetRootResourceId() const { | 1135 std::string APIUtil::GetRootResourceId() const { |
| 1135 if (IsDriveAPIDisabled()) | 1136 if (IsDriveAPIDisabled()) |
| 1136 return drive_service_->GetRootResourceId(); | 1137 return drive_service_->GetRootResourceId(); |
| 1137 return root_resource_id_; | 1138 return root_resource_id_; |
| 1138 } | 1139 } |
| 1139 | 1140 |
| 1140 } // namespace drive_backend | 1141 } // namespace drive_backend |
| 1141 } // namespace sync_file_system | 1142 } // namespace sync_file_system |
| OLD | NEW |