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

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

Issue 10837201: Pass parsed ChangeList to GDataFileSystem. (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 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)) {

Powered by Google App Engine
This is Rietveld 408576698