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

Unified Diff: chrome/browser/chromeos/drive/search_metadata.cc

Issue 384543004: Get rid of DriveEntryKind. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed some temporary variables and IsHostedDocumentByFileExtension(). Created 6 years, 5 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/drive/search_metadata.cc
diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc
index e08463f88863c7e2653df82534e189cfe2737a4e..04409fa8d5aa852946c7c809d29e8e8f3d82750a 100644
--- a/chrome/browser/chromeos/drive/search_metadata.cc
+++ b/chrome/browser/chromeos/drive/search_metadata.cc
@@ -13,8 +13,8 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
+#include "chrome/browser/drive/drive_api_util.h"
#include "content/public/browser/browser_thread.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
#include "net/base/escape.h"
using content::BrowserThread;
@@ -166,16 +166,12 @@ bool IsEligibleEntry(const ResourceEntry& entry, int options) {
if (entry.file_specific_info().is_hosted_document()) {
// Not all hosted documents are cached by Drive offline app.
// http://support.google.com/drive/bin/answer.py?hl=en&answer=1628467
- switch (google_apis::ResourceEntry::GetEntryKindFromExtension(
- entry.file_specific_info().document_extension())) {
- case google_apis::ENTRY_KIND_DOCUMENT:
- case google_apis::ENTRY_KIND_SPREADSHEET:
- case google_apis::ENTRY_KIND_PRESENTATION:
- case google_apis::ENTRY_KIND_DRAWING:
- return true;
- default:
- return false;
- }
+ std::string mime_type = drive::util::GetHostedDocumentMimeType(
+ entry.file_specific_info().document_extension());
+ return mime_type == drive::util::kGoogleDocumentMimeType ||
+ mime_type == drive::util::kGoogleSpreadsheetMimeType ||
+ mime_type == drive::util::kGooglePresentationMimeType ||
+ mime_type == drive::util::kGoogleDrawingMimeType;
} else {
return entry.file_specific_info().cache_state().is_present();
}

Powered by Google App Engine
This is Rietveld 408576698