| 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 aef6deec20736986b4c37d04f8d83447655d5bc3..52363b5c5854a0cbd0e68f9fa7c72f619ffb2164 100644
|
| --- a/chrome/browser/chromeos/gdata/drive_api_parser.cc
|
| +++ b/chrome/browser/chromeos/gdata/drive_api_parser.cc
|
| @@ -118,6 +118,18 @@ const char kFile[] = "file";
|
| // https://developers.google.com/drive/v2/reference/changes/list
|
| const char kChangeListKind[] = "drive#changeList";
|
|
|
| +// Google Apps MIME types:
|
| +const char kGoogleDocumentMimeType[] = "application/vnd.google-apps.document";
|
| +const char kGoogleDrawingMimeType[] = "application/vnd.google-apps.drawing";
|
| +const char kGoogleFormMimeType[] = "application/vnd.google-apps.form";
|
| +const char kGooglePresentationMimeType[] =
|
| + "application/vnd.google-apps.presentation";
|
| +const char kGoogleScriptMimeType[] = "application/vnd.google-apps.script";
|
| +const char kGoogleSiteMimeType[] = "application/vnd.google-apps.site";
|
| +const char kGoogleSpreadsheetMimeType[] =
|
| + "application/vnd.google-apps.spreadsheet";
|
| +const char kGoogleTableMimeType[] = "application/vnd.google-apps.table";
|
| +
|
| // Maps category name to enum IconCategory.
|
| struct AppIconCategoryMap {
|
| gdata::DriveAppIcon::IconCategory category;
|
| @@ -430,6 +442,24 @@ bool FileResource::IsDirectory() const {
|
| return mime_type_ == kDriveFolderMimeType;
|
| }
|
|
|
| +DocumentEntry::EntryKind FileResource::GetKind() const {
|
| + if (mime_type() == kGoogleDocumentMimeType)
|
| + return DocumentEntry::DOCUMENT;
|
| + if (mime_type() == kGoogleSpreadsheetMimeType)
|
| + return DocumentEntry::SPREADSHEET;
|
| + if (mime_type() == kGooglePresentationMimeType)
|
| + return DocumentEntry::PRESENTATION;
|
| + if (mime_type() == kGoogleDrawingMimeType)
|
| + return DocumentEntry::DRAWING;
|
| + if (mime_type() == kGoogleTableMimeType)
|
| + return DocumentEntry::TABLE;
|
| + if (mime_type() == kDriveFolderMimeType)
|
| + return DocumentEntry::FOLDER;
|
| + if (mime_type() == "application/pdf")
|
| + return DocumentEntry::PDF;
|
| + return DocumentEntry::FILE;
|
| +}
|
| +
|
| bool FileResource::Parse(const base::Value& value) {
|
| base::JSONValueConverter<FileResource> converter;
|
| if (!converter.Convert(value, this)) {
|
|
|