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

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

Issue 384543004: Get rid of DriveEntryKind. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and drop an unit test for glink file. 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/resource_entry_conversion.cc
diff --git a/chrome/browser/chromeos/drive/resource_entry_conversion.cc b/chrome/browser/chromeos/drive/resource_entry_conversion.cc
index ebaaadb6d3115c509bd07d4466922307478360c7..a9c3f21ac05d91f578e48ed6761b83dce6f69bf4 100644
--- a/chrome/browser/chromeos/drive/resource_entry_conversion.cc
+++ b/chrome/browser/chromeos/drive/resource_entry_conversion.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/drive/drive_api_util.h"
#include "google_apis/drive/drive_api_parser.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
namespace drive {
@@ -77,16 +76,10 @@ bool ConvertFileResourceToResourceEntry(
input.last_viewed_by_me_date().ToInternalValue());
file_info->set_creation_time(input.created_date().ToInternalValue());
- // TODO(hashimoto): Get rid of WAPI stuff. crbug.com/357038
- const google_apis::DriveEntryKind entry_kind = util::GetKind(input);
- const int entry_kind_class =
- google_apis::ResourceEntry::ClassifyEntryKind(entry_kind);
- const bool is_file = entry_kind_class &
- google_apis::ResourceEntry::KIND_OF_FILE;
- const bool is_hosted_document = entry_kind_class &
- google_apis::ResourceEntry::KIND_OF_HOSTED_DOCUMENT;
- const bool is_folder = entry_kind_class &
- google_apis::ResourceEntry::KIND_OF_FOLDER;
+ const bool is_folder = input.IsDirectory();
+ const bool is_hosted_document =
+ drive::util::IsHostedDocument(input.mime_type());
+ const bool is_file = !is_folder && !is_hosted_document;
hashimoto 2014/07/14 08:23:26 nit: No need to have this bool now?
fukino 2014/07/14 09:10:53 Done. Removed these temporary bool variables.
if (is_file || is_hosted_document) {
FileSpecificInfo* file_specific_info =
@@ -100,7 +93,7 @@ bool ConvertFileResourceToResourceEntry(
// TODO(satorux): Figure out better way how to pass input info like kind
// to UI through the File API stack.
const std::string document_extension =
- google_apis::ResourceEntry::GetHostedDocumentExtension(entry_kind);
+ drive::util::GetHostedDocumentExtension(input.mime_type());
file_specific_info->set_document_extension(document_extension);
converted.set_base_name(
util::NormalizeFileName(converted.title() + document_extension));

Powered by Google App Engine
This is Rietveld 408576698