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

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

Issue 10861015: gdata: Add GDataDirectoryService::GetEntryInfoByResourceId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address 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
Index: chrome/browser/chromeos/gdata/gdata_directory_service.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_directory_service.cc b/chrome/browser/chromeos/gdata/gdata_directory_service.cc
index 54fcfecd49fe2bba50adb4a54466d68cf2dc7aa7..df0192249c344edec92e59b8fe7f9e9e6b4b4c1b 100644
--- a/chrome/browser/chromeos/gdata/gdata_directory_service.cc
+++ b/chrome/browser/chromeos/gdata/gdata_directory_service.cc
@@ -326,6 +326,29 @@ void GDataDirectoryService::GetEntryByResourceIdAsync(
callback.Run(entry);
}
+void GDataDirectoryService::GetEntryInfoByResourceId(
+ const std::string& resource_id,
+ const GetEntryInfoCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ scoped_ptr<GDataEntryProto> entry_proto;
+ GDataFileError error = GDATA_FILE_ERROR_FAILED;
+
+ GDataEntry* entry = GetEntryByResourceId(resource_id);
+ if (entry) {
+ entry_proto.reset(new GDataEntryProto);
+ entry->ToProtoFull(entry_proto.get());
+ error = GDATA_FILE_OK;
+ } else {
+ error = GDATA_FILE_ERROR_NOT_FOUND;
+ }
+
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, error, base::Passed(&entry_proto)));
+}
+
void GDataDirectoryService::GetEntryInfoByPath(
const FilePath& path,
const GetEntryInfoCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698