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

Unified Diff: chrome/browser/chromeos/gdata/drive_api_parser.cc

Issue 10855017: Add missing fields in Drive V2 API parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: chrome/browser/chromeos/gdata/drive_api_parser.cc
diff --git a/chrome/browser/chromeos/gdata/drive_api_parser.cc b/chrome/browser/chromeos/gdata/drive_api_parser.cc
index d906ca4e032e559ca3ed53f1ddd9b2245eba8f89..f1e7ce740c6ff1bda292fcc30fcb4e4530f76981 100644
--- a/chrome/browser/chromeos/gdata/drive_api_parser.cc
+++ b/chrome/browser/chromeos/gdata/drive_api_parser.cc
@@ -38,6 +38,7 @@ const char kId[] = "id";
const char kETag[] = "etag";
const char kItems[] = "items";
const char kLargestChangeId[] = "largestChangeId";
+const char kSelfLink[] = "selfLink";
// About Resource:
const char kAboutKind[] = "drive#about";
@@ -70,18 +71,25 @@ const char kAppListKind[] = "drive#appList";
// Parent Resource:
const char kParentReferenceKind[] = "drive#parentReference";
+const char kParentLink[] = "parentLink";
const char kIsRoot[] = "isRoot";
// File Resource:
const char kFileKind[] = "drive#file";
const char kMimeType[] = "mimeType";
const char kTitle[] = "title";
+const char kCreatedDate[] = "createdDate";
const char kModifiedByMeDate[] = "modifiedByMeDate";
const char kParents[] = "parents";
const char kDownloadUrl[] = "downloadUrl";
const char kFileExtension[] = "fileExtension";
const char kMd5Checksum[] = "md5Checksum";
const char kFileSize[] = "fileSize";
+const char kAlternateLink[] = "alternateLink";
hashimoto 2012/08/07 04:19:02 Is there a policy to order these values? If so, pl
kochi 2012/08/07 05:24:37 Basically this order follows the order in Drive V2
+const char kEmbedLink[] = "embedLink";
+const char kThumbnailLink[] = "thumbnailLink";
+const char kWebContentLink[] = "webContentLink";
+const char kExplicitlyTrashed[] = "explicitlyTrashed";
hashimoto 2012/08/07 04:19:02 What is this for?
kochi 2012/08/07 05:24:37 Removed.
const char kDriveFolderMimeType[] = "application/vnd.google-apps.folder";
@@ -319,6 +327,9 @@ ParentReference::~ParentReference() {}
void ParentReference::RegisterJSONConverter(
base::JSONValueConverter<ParentReference>* converter) {
converter->RegisterStringField(kId, &ParentReference::file_id_);
+ converter->RegisterCustomField<GURL>(kParentLink,
+ &ParentReference::parent_link_,
+ GetGURLFromString);
converter->RegisterBoolField(kIsRoot, &ParentReference::is_root_);
}
@@ -358,20 +369,39 @@ void FileResource::RegisterJSONConverter(
converter->RegisterStringField(kMimeType, &FileResource::mime_type_);
converter->RegisterStringField(kTitle, &FileResource::title_);
converter->RegisterCustomField<base::Time>(
+ kCreatedDate,
+ &FileResource::created_date_,
+ &gdata::util::GetTimeFromString);
+ converter->RegisterCustomField<base::Time>(
kModifiedByMeDate,
&FileResource::modified_by_me_date_,
&gdata::util::GetTimeFromString);
converter->RegisterRepeatedMessage<ParentReference>(kParents,
&FileResource::parents_);
- converter->RegisterCustomField<GURL>(kDownloadUrl,
- &FileResource::download_url_,
- GetGURLFromString);
converter->RegisterStringField(kFileExtension,
&FileResource::file_extension_);
converter->RegisterStringField(kMd5Checksum, &FileResource::md5_checksum_);
converter->RegisterCustomField<int64>(kFileSize,
&FileResource::file_size_,
&base::StringToInt64);
+ converter->RegisterCustomField<GURL>(kDownloadUrl,
+ &FileResource::download_url_,
+ GetGURLFromString);
+ converter->RegisterCustomField<GURL>(kSelfLink,
+ &FileResource::self_link_,
+ GetGURLFromString);
+ converter->RegisterCustomField<GURL>(kAlternateLink,
+ &FileResource::alternate_link_,
+ GetGURLFromString);
+ converter->RegisterCustomField<GURL>(kEmbedLink,
+ &FileResource::embed_link_,
+ GetGURLFromString);
+ converter->RegisterCustomField<GURL>(kThumbnailLink,
+ &FileResource::thumbnail_link_,
+ GetGURLFromString);
+ converter->RegisterCustomField<GURL>(kWebContentLink,
+ &FileResource::web_content_link_,
+ GetGURLFromString);
}
// static
« no previous file with comments | « chrome/browser/chromeos/gdata/drive_api_parser.h ('k') | chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698