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

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

Issue 10837148: gdata: Add GetEntryInfoByPath() and ReadDirectoryByPath() to GDataDirectoryService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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_file_system.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index 624e6ae10afdb23545a07d353bf6f43bec3e37b9..c629eea5f8477b16fa4c2bc3ac16e283ccb7aa7b 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -1836,7 +1836,7 @@ void GDataFileSystem::OnGetEntryInfo(const GetEntryInfoCallback& callback,
void GDataFileSystem::ReadDirectoryByPath(
const FilePath& file_path,
- const ReadDirectoryCallback& callback) {
+ const ReadDirectoryWithSettingCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::IO));
RunTaskOnUIThread(
@@ -1848,7 +1848,7 @@ void GDataFileSystem::ReadDirectoryByPath(
void GDataFileSystem::ReadDirectoryByPathAsyncOnUIThread(
const FilePath& file_path,
- const ReadDirectoryCallback& callback) {
+ const ReadDirectoryWithSettingCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
FindEntryByPathAsyncOnUIThread(
@@ -1858,9 +1858,10 @@ void GDataFileSystem::ReadDirectoryByPathAsyncOnUIThread(
callback));
}
-void GDataFileSystem::OnReadDirectory(const ReadDirectoryCallback& callback,
- GDataFileError error,
- GDataEntry* entry) {
+void GDataFileSystem::OnReadDirectory(
+ const ReadDirectoryWithSettingCallback& callback,
+ GDataFileError error,
+ GDataEntry* entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (error != GDATA_FILE_OK) {
@@ -1881,21 +1882,7 @@ void GDataFileSystem::OnReadDirectory(const ReadDirectoryCallback& callback,
return;
}
- scoped_ptr<GDataEntryProtoVector> entries(new GDataEntryProtoVector);
- for (GDataFileCollection::const_iterator iter =
- directory->child_files().begin();
- iter != directory->child_files().end(); ++iter) {
- GDataEntryProto proto;
- static_cast<const GDataEntry*>(iter->second)->ToProtoFull(&proto);
- entries->push_back(proto);
- }
- for (GDataDirectoryCollection::const_iterator iter =
- directory->child_directories().begin();
- iter != directory->child_directories().end(); ++iter) {
- GDataEntryProto proto;
- static_cast<const GDataEntry*>(iter->second)->ToProtoFull(&proto);
- entries->push_back(proto);
- }
+ scoped_ptr<GDataEntryProtoVector> entries(directory->ToProtoVector());
if (!callback.is_null())
callback.Run(GDATA_FILE_OK, hide_hosted_docs_, entries.Pass());
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.h ('k') | chrome/browser/chromeos/gdata/gdata_file_system_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698