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

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

Issue 9581024: Added proper extensions for hosted documents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/gdata_parser.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_parser.cc (revision 124744)
+++ chrome/browser/chromeos/gdata/gdata_parser.cc (working copy)
@@ -36,19 +36,20 @@
struct EntryKindMap {
DocumentEntry::EntryKind kind;
const char* entry;
+ const char* extension;
};
const EntryKindMap kEntryKindMap[] = {
- { DocumentEntry::ITEM, "item" },
- { DocumentEntry::DOCUMENT, "document"},
- { DocumentEntry::SPREADSHEET, "spreadsheet" },
- { DocumentEntry::PRESENTATION, "presentation" },
- { DocumentEntry::DRAWING, "drawing"},
- { DocumentEntry::TABLE, "table"},
- { DocumentEntry::SITE, "site"},
- { DocumentEntry::FOLDER, "folder"},
- { DocumentEntry::FILE, "file"},
- { DocumentEntry::PDF, "pdf"},
+ { DocumentEntry::ITEM, "item", NULL},
+ { DocumentEntry::DOCUMENT, "document", ".gdoc"},
+ { DocumentEntry::SPREADSHEET, "spreadsheet", ".gsheet"},
+ { DocumentEntry::PRESENTATION, "presentation", ".gslides" },
+ { DocumentEntry::DRAWING, "drawing", ".gdraw"},
+ { DocumentEntry::TABLE, "table", ".gtable"},
+ { DocumentEntry::SITE, "site", NULL},
+ { DocumentEntry::FOLDER, "folder", NULL},
+ { DocumentEntry::FILE, "file", NULL},
+ { DocumentEntry::PDF, "pdf", NULL},
};
struct LinkTypeMap {
@@ -346,18 +347,16 @@
kSuggestedFileNameField, &DocumentEntry::suggested_filename_);
}
-std::string DocumentEntry::GetEntryKindText() const {
- return std::string(GetEntryKindDescription(kind_));
-}
-
-// static
-const char* DocumentEntry::GetEntryKindDescription(
- DocumentEntry::EntryKind kind) {
+std::string DocumentEntry::GetHostedDocumentExtension() const {
for (size_t i = 0; i < arraysize(kEntryKindMap); i++) {
- if (kEntryKindMap[i].kind == kind)
- return kEntryKindMap[i].entry;
+ if (kEntryKindMap[i].kind == kind_) {
+ if (kEntryKindMap[i].extension)
+ return std::string(kEntryKindMap[i].extension);
+ else
+ return std::string();
+ }
}
- return "";
+ return std::string();
}
// static
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_parser.h ('k') | chrome/browser/resources/file_manager/css/file_manager.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698