Chromium Code Reviews| 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..c6d3a3dfec690ee44a0435b065d2a03687056c1a 100644 |
| --- a/chrome/browser/chromeos/gdata/drive_api_parser.cc |
| +++ b/chrome/browser/chromeos/gdata/drive_api_parser.cc |
| @@ -15,6 +15,7 @@ |
| #include "base/string_util.h" |
| #include "base/values.h" |
| #include "chrome/browser/chromeos/gdata/gdata_util.h" |
| +#include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
| using base::Value; |
| using base::DictionaryValue; |
| @@ -118,6 +119,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 +443,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; |
|
satorux1
2012/08/10 18:14:34
I think the changes in drive_api_parser.h/cc can b
kochi
2012/08/13 09:08:39
Done.
https://chromiumcodereview.appspot.com/10828
|
| +} |
| + |
| bool FileResource::Parse(const base::Value& value) { |
| base::JSONValueConverter<FileResource> converter; |
| if (!converter.Convert(value, this)) { |