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

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

Issue 9545006: This adds some GData private API to the file manager (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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/gdata/gdata_file_system.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index ac0ff357b4452e7920253da3aaf3d80a376020bf..c8a27f2d5bb6a660c5167577aeaea4e76325907d 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -188,13 +188,31 @@ GDataFileBase* GDataFile::FromDocumentEntry(GDataDirectory* parent,
file->file_info_.last_modified = doc->updated_time();
file->file_info_.last_accessed = doc->updated_time();
file->file_info_.creation_time = doc->published_time();
+
+ // Fetch the list of authors and their emails.
+ const ScopedVector<Author>& authors = doc->authors();
zel 2012/02/29 23:46:38 kill authors, sorry for the confusion
+ file->authors_.resize(authors.size());
+ for (ScopedVector<Author>::const_iterator iter = authors.begin();
+ iter != authors.end(); ++iter) {
+ std::string name = UTF16ToUTF8((*iter)->name());
+ file->authors_.push_back(std::make_pair(name, (*iter)->email()));
+ }
+ const Link* thumbnail_link = doc->GetLinkByType(Link::THUMBNAIL);
+ if (thumbnail_link)
+ file->thumbnail_url_ = thumbnail_link->href();
+
+ // TODO(gspencer): Add support for reading pinned state from the cache,
+ // when the cache code is done.
+
return file;
}
// GDataFile class implementation.
GDataFile::GDataFile(GDataDirectory* parent)
- : GDataFileBase(parent), kind_(gdata::DocumentEntry::UNKNOWN) {
+ : GDataFileBase(parent),
+ kind_(gdata::DocumentEntry::UNKNOWN),
+ pinned_state_(PINNED_STATE_NONE) {
DCHECK(parent);
}

Powered by Google App Engine
This is Rietveld 408576698