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

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

Issue 10834304: Handle trashed file properly (Drive V2 API) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comments. Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_wapi_parser.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_wapi_parser.cc b/chrome/browser/chromeos/gdata/gdata_wapi_parser.cc
index f0df48356ec06dc3b313bee57d1ffa0905f5eabe..871018c59a0985c40e09a80b565eed66610727e9 100644
--- a/chrome/browser/chromeos/gdata/gdata_wapi_parser.cc
+++ b/chrome/browser/chromeos/gdata/gdata_wapi_parser.cc
@@ -825,8 +825,10 @@ DocumentEntry* DocumentEntry::CreateFromFileResource(const FileResource& file) {
entry->file_md5_ = file.md5_checksum();
entry->file_size_ = file.file_size();
- entry->deleted_ = false; // later filled by CreateFromChangeResource.
- entry->removed_ = false; // later filled by CreateFromChangeResource.
+ // If file is removed completely, that information is only available in
+ // ChangeResource, and is reflected in |removed_|. If file is trashed, the
+ // file entry still exists but with its "trashed" label true.
+ entry->deleted_ = file.labels().is_trashed();
// FeedEntry
entry->etag_ = file.etag();
@@ -875,7 +877,7 @@ DocumentEntry*
DocumentEntry::CreateFromChangeResource(const ChangeResource& change) {
DocumentEntry* entry = CreateFromFileResource(change.file());
- entry->deleted_ = change.is_deleted();
+ // If |is_deleted()| returns true, the file is removed from Drive.
entry->removed_ = change.is_deleted();
return entry;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698