diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 19:37:45 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 19:37:45 +0000 |
commit | 0b2b1ed23c26976170835414e2a47522c9abf19b (patch) | |
tree | 2f9b4d63daf0fefa0a18370ea5f61aff00884253 /google_apis/drive | |
parent | bbda18e5b18bf55351a04290efccd5d943e835f2 (diff) | |
download | chromium_src-0b2b1ed23c26976170835414e2a47522c9abf19b.zip chromium_src-0b2b1ed23c26976170835414e2a47522c9abf19b.tar.gz chromium_src-0b2b1ed23c26976170835414e2a47522c9abf19b.tar.bz2 |
Google drive forms should not appear in the "offline" tab of Files.app.
They are not offline available.
See the comments added in the patch and metadata_cache.js.
BUG=none
Review URL: https://codereview.chromium.org/103013004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis/drive')
-rw-r--r-- | google_apis/drive/gdata_wapi_parser.cc | 18 | ||||
-rw-r--r-- | google_apis/drive/gdata_wapi_parser.h | 3 |
2 files changed, 15 insertions, 6 deletions
diff --git a/google_apis/drive/gdata_wapi_parser.cc b/google_apis/drive/gdata_wapi_parser.cc index 1951c17..2f3c978 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 diff --git a/google_apis/drive/gdata_wapi_parser.h b/google_apis/drive/gdata_wapi_parser.h index 0c89c11..a7ac493 100644 --- a/google_apis/drive/gdata_wapi_parser.h +++ b/google_apis/drive/gdata_wapi_parser.h @@ -509,6 +509,9 @@ class ResourceEntry : public CommonMetadata { KIND_OF_FILE = 1 << 4, }; + // Returns the kind enum corresponding to the extension in form ".xxx". + static DriveEntryKind GetEntryKindFromExtension(const std::string& extension); + // Classifies the EntryKind. The returned value is a bitmask of // EntryKindClass. For example, DOCUMENT is classified as // KIND_OF_HOSTED_DOCUMENT and KIND_OF_GOOGLE_DOCUMENT, hence the returned |