Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: components/drive/resource_entry_conversion.cc

Issue 2799603002: Process TeamDrive change in change list. (Closed)
Patch Set: Add test for update. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/drive/resource_entry_conversion.cc
diff --git a/components/drive/resource_entry_conversion.cc b/components/drive/resource_entry_conversion.cc
index 52eda29bffc8b0f0c4a9c826d707920a90129d48..ec88d782b5ea20f87796d4e560b158ace8321e61 100644
--- a/components/drive/resource_entry_conversion.cc
+++ b/components/drive/resource_entry_conversion.cc
@@ -29,7 +29,7 @@ bool ConvertChangeResourceToResourceEntry(
if (input.file() &&
!ConvertFileResourceToResourceEntry(*input.file(), &converted,
&parent_resource_id))
- return false;
+ return false;
converted.set_resource_id(input.file_id());
converted.set_deleted(converted.deleted() || input.is_deleted());
@@ -141,4 +141,23 @@ void ConvertResourceEntryToFileInfo(const ResourceEntry& entry,
entry.file_info().creation_time());
}
+bool ConvertChangeResourceToTeamDriveChange(
+ const google_apis::ChangeResource& input,
+ TeamDriveChange* out_entry) {
+ DCHECK(out_entry);
+ DCHECK_EQ(google_apis::ChangeResource::TEAM_DRIVE, input.type());
+
+ TeamDriveChange converted;
+ if (!input.team_drive()) {
+ LOG(ERROR) << "team_drive field is empty";
+ return false;
+ }
+
+ converted.set_name(input.team_drive()->name());
+ converted.set_id(input.team_drive()->id());
+ converted.set_modification_date(input.modification_date().ToInternalValue());
+ out_entry->Swap(&converted);
+ return true;
+}
+
} // namespace drive

Powered by Google App Engine
This is Rietveld 408576698