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_v1/api_util.h" | 5 #include "chrome/browser/sync_file_system/drive_backend_v1/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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 directory_name, | 314 directory_name, |
315 callback)); | 315 callback)); |
316 } | 316 } |
317 | 317 |
318 void APIUtil::DidGetDirectory(const std::string& parent_resource_id, | 318 void APIUtil::DidGetDirectory(const std::string& parent_resource_id, |
319 const std::string& directory_name, | 319 const std::string& directory_name, |
320 const ResourceIdCallback& callback, | 320 const ResourceIdCallback& callback, |
321 google_apis::GDataErrorCode error, | 321 google_apis::GDataErrorCode error, |
322 scoped_ptr<google_apis::ResourceList> feed) { | 322 scoped_ptr<google_apis::ResourceList> feed) { |
323 DCHECK(CalledOnValidThread()); | 323 DCHECK(CalledOnValidThread()); |
324 DCHECK(IsStringASCII(directory_name)); | 324 DCHECK(base::IsStringASCII(directory_name)); |
325 | 325 |
326 if (error != google_apis::HTTP_SUCCESS) { | 326 if (error != google_apis::HTTP_SUCCESS) { |
327 DVLOG(2) << "Error on getting Drive directory: " << error; | 327 DVLOG(2) << "Error on getting Drive directory: " << error; |
328 callback.Run(error, std::string()); | 328 callback.Run(error, std::string()); |
329 return; | 329 return; |
330 } | 330 } |
331 | 331 |
332 std::string resource_id; | 332 std::string resource_id; |
333 ParentType parent_type = PARENT_TYPE_DIRECTORY; | 333 ParentType parent_type = PARENT_TYPE_DIRECTORY; |
334 if (parent_resource_id.empty()) { | 334 if (parent_resource_id.empty()) { |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 } | 1134 } |
1135 | 1135 |
1136 std::string APIUtil::GetRootResourceId() const { | 1136 std::string APIUtil::GetRootResourceId() const { |
1137 if (IsDriveAPIDisabled()) | 1137 if (IsDriveAPIDisabled()) |
1138 return drive_service_->GetRootResourceId(); | 1138 return drive_service_->GetRootResourceId(); |
1139 return root_resource_id_; | 1139 return root_resource_id_; |
1140 } | 1140 } |
1141 | 1141 |
1142 } // namespace drive_backend | 1142 } // namespace drive_backend |
1143 } // namespace sync_file_system | 1143 } // namespace sync_file_system |
OLD | NEW |