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

Unified Diff: google_apis/drive/gdata_wapi_parser.cc

Issue 103013004: Google drive forms should not appear in the "offline" tab of Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « google_apis/drive/gdata_wapi_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/gdata_wapi_parser.cc
diff --git a/google_apis/drive/gdata_wapi_parser.cc b/google_apis/drive/gdata_wapi_parser.cc
index 1951c177a5e904aa6bca86f0aea940a0f8337361..2f3c97847a16254864334acb6c384a7da9f0016b 100644
--- a/google_apis/drive/gdata_wapi_parser.cc
+++ b/google_apis/drive/gdata_wapi_parser.cc
@@ -536,6 +536,17 @@ std::string ResourceEntry::GetHostedDocumentExtension() const {
}
// static
+DriveEntryKind ResourceEntry::GetEntryKindFromExtension(
+ const std::string& extension) {
+ for (size_t i = 0; i < arraysize(kEntryKindMap); ++i) {
+ const char* document_extension = kEntryKindMap[i].extension;
+ if (document_extension && extension == document_extension)
+ return kEntryKindMap[i].kind;
+ }
+ return ENTRY_KIND_UNKNOWN;
+}
+
+// static
int ResourceEntry::ClassifyEntryKindByFileExtension(
const base::FilePath& file_path) {
#if defined(OS_WIN)
@@ -543,12 +554,7 @@ int ResourceEntry::ClassifyEntryKindByFileExtension(
#else
std::string file_extension = file_path.Extension();
#endif
- for (size_t i = 0; i < arraysize(kEntryKindMap); ++i) {
- const char* document_extension = kEntryKindMap[i].extension;
- if (document_extension && file_extension == document_extension)
- return ClassifyEntryKind(kEntryKindMap[i].kind);
- }
- return 0;
+ return ClassifyEntryKind(GetEntryKindFromExtension(file_extension));
}
// static
« no previous file with comments | « google_apis/drive/gdata_wapi_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698