OLD | NEW |
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 #ifndef COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ | 5 #ifndef COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ |
6 #define COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ | 6 #define COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 | 11 |
12 namespace google_apis { | 12 namespace google_apis { |
13 class ChangeResource; | 13 class ChangeResource; |
14 class FileResource; | 14 class FileResource; |
| 15 class TeamDriveResource; |
15 } | 16 } |
16 | 17 |
17 namespace drive { | 18 namespace drive { |
18 | 19 |
19 class ResourceEntry; | 20 class ResourceEntry; |
20 | 21 |
21 // Converts a google_apis::ChangeResource into a drive::ResourceEntry. | 22 // Converts a google_apis::ChangeResource into a drive::ResourceEntry. |
22 // If the conversion succeeded, return true and sets the result to |out_entry|. | 23 // If the conversion succeeded, return true and sets the result to |out_entry|. |
23 // |out_parent_resource_id| will be set to the resource ID of the parent entry. | 24 // |out_parent_resource_id| will be set to the resource ID of the parent entry. |
24 // If failed, it returns false and keeps output arguments untouched. | 25 // If failed, it returns false and keeps output arguments untouched. |
(...skipping 12 matching lines...) Expand all Loading... |
37 ResourceEntry* out_entry, | 38 ResourceEntry* out_entry, |
38 std::string* out_parent_resource_id); | 39 std::string* out_parent_resource_id); |
39 | 40 |
40 // Converts a google_apis::FileResource into a drive::ResourceEntry. | 41 // Converts a google_apis::FileResource into a drive::ResourceEntry. |
41 // Also see the comment for ConvertChangeResourceToResourceEntry above. | 42 // Also see the comment for ConvertChangeResourceToResourceEntry above. |
42 bool ConvertFileResourceToResourceEntry( | 43 bool ConvertFileResourceToResourceEntry( |
43 const google_apis::FileResource& input, | 44 const google_apis::FileResource& input, |
44 ResourceEntry* out_entry, | 45 ResourceEntry* out_entry, |
45 std::string* out_parent_resource_id); | 46 std::string* out_parent_resource_id); |
46 | 47 |
| 48 // Converts a TeamDriveResource into a drive::ResourceEntry. |
| 49 void ConvertTeamDriveResourceToResourceEntry( |
| 50 const google_apis::TeamDriveResource& input, |
| 51 ResourceEntry* out_entry); |
| 52 |
47 // Converts the resource entry to the platform file info. | 53 // Converts the resource entry to the platform file info. |
48 void ConvertResourceEntryToFileInfo(const ResourceEntry& entry, | 54 void ConvertResourceEntryToFileInfo(const ResourceEntry& entry, |
49 base::File::Info* file_info); | 55 base::File::Info* file_info); |
50 | 56 |
51 } // namespace drive | 57 } // namespace drive |
52 | 58 |
53 #endif // COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ | 59 #endif // COMPONENTS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_ |
OLD | NEW |