| 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 dbac872e1e02f01cbcb98b8a5e338196cd80d7bd..7c7ff8262e9abe04e90708621507a94a871edce7 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
|
| @@ -454,6 +454,7 @@ void AddEntryToSearchResults(
|
| const SearchCallback& callback,
|
| GDataFileError error,
|
| bool run_callback,
|
| + const GURL& next_feed,
|
| GDataEntry* entry) {
|
| // If a result is not present in our local file system snapshot, ignore it.
|
| // For example, this may happen if the entry has recently been added to the
|
| @@ -466,7 +467,7 @@ void AddEntryToSearchResults(
|
| if (run_callback) {
|
| scoped_ptr<std::vector<SearchResultInfo> > result_vec(results);
|
| if (!callback.is_null())
|
| - callback.Run(error, result_vec.Pass());
|
| + callback.Run(error, next_feed, result_vec.Pass());
|
| }
|
| }
|
|
|
| @@ -1012,6 +1013,7 @@ void GDataFileSystem::OnGetAccountMetadata(
|
| true, /* should_fetch_multiple_feeds */
|
| search_file_path,
|
| std::string() /* no search query */,
|
| + GURL(), /* feed not explicitly set */
|
| std::string() /* no directory resource ID */,
|
| callback,
|
| base::Bind(&GDataFileSystem::OnFeedFromServerLoaded,
|
| @@ -1041,6 +1043,7 @@ void GDataFileSystem::OnGetAccountMetadata(
|
| true, /* should_fetch_multiple_feeds */
|
| search_file_path,
|
| std::string() /* no search query */,
|
| + GURL(), /* feed not explicitly set */
|
| std::string() /* no directory resource ID */,
|
| callback,
|
| base::Bind(&GDataFileSystem::OnFeedFromServerLoaded,
|
| @@ -1076,6 +1079,7 @@ void GDataFileSystem::OnGetAccountMetadata(
|
| true, /* should_fetch_multiple_feeds */
|
| search_file_path,
|
| std::string() /* no search query */,
|
| + GURL(), /* feed not explicitly set */
|
| std::string() /* no directory resource ID */,
|
| callback,
|
| base::Bind(&GDataFileSystem::OnFeedFromServerLoaded,
|
| @@ -1089,6 +1093,7 @@ void GDataFileSystem::LoadFeedFromServer(
|
| bool should_fetch_multiple_feeds,
|
| const FilePath& search_file_path,
|
| const std::string& search_query,
|
| + const GURL& feed_to_load,
|
| const std::string& directory_resource_id,
|
| const FindEntryCallback& entry_found_callback,
|
| const LoadDocumentFeedCallback& feed_load_callback) {
|
| @@ -1100,7 +1105,7 @@ void GDataFileSystem::LoadFeedFromServer(
|
| new std::vector<DocumentFeed*>);
|
| const base::TimeTicks start_time = base::TimeTicks::Now();
|
| documents_service_->GetDocuments(
|
| - GURL(), // root feed start.
|
| + feed_to_load,
|
| start_changestamp,
|
| search_query,
|
| directory_resource_id,
|
| @@ -2385,6 +2390,7 @@ void GDataFileSystem::RequestDirectoryRefreshOnUIThreadAfterGetEntryInfo(
|
| true, // multiple feeds
|
| file_path,
|
| std::string(), // No search query
|
| + GURL(), /* feed not explicitly set */
|
| entry_proto->resource_id(),
|
| FindEntryCallback(), // Not used.
|
| base::Bind(&GDataFileSystem::OnRequestDirectoryRefresh,
|
| @@ -2715,7 +2721,7 @@ void GDataFileSystem::OnSearch(const SearchCallback& callback,
|
|
|
| if (error != GDATA_FILE_OK) {
|
| if (!callback.is_null())
|
| - callback.Run(error, scoped_ptr<std::vector<SearchResultInfo> >());
|
| + callback.Run(error, GURL(), scoped_ptr<std::vector<SearchResultInfo> >());
|
| return;
|
| }
|
|
|
| @@ -2727,10 +2733,14 @@ void GDataFileSystem::OnSearch(const SearchCallback& callback,
|
| DCHECK_EQ(1u, params->feed_list->size());
|
| DocumentFeed* feed = params->feed_list->at(0);
|
|
|
| + // TODO(tbarzic): Limit total number of returned results for the query.
|
| + GURL next_feed;
|
| + feed->GetNextFeedURL(&next_feed);
|
| +
|
| if (feed->entries().empty()) {
|
| scoped_ptr<std::vector<SearchResultInfo> > result_vec(results);
|
| if (!callback.is_null())
|
| - callback.Run(error, result_vec.Pass());
|
| + callback.Run(error, next_feed, result_vec.Pass());
|
| return;
|
| }
|
|
|
| @@ -2766,22 +2776,26 @@ void GDataFileSystem::OnSearch(const SearchCallback& callback,
|
| results,
|
| callback,
|
| error,
|
| - i+1 == feed->entries().size()));
|
| + i+1 == feed->entries().size(),
|
| + next_feed));
|
| }
|
| }
|
|
|
| void GDataFileSystem::Search(const std::string& search_query,
|
| + const GURL& next_feed,
|
| const SearchCallback& callback) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
|
| BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| RunTaskOnUIThread(base::Bind(&GDataFileSystem::SearchAsyncOnUIThread,
|
| ui_weak_ptr_,
|
| search_query,
|
| + next_feed,
|
| CreateRelayCallback(callback)));
|
| }
|
|
|
| void GDataFileSystem::SearchAsyncOnUIThread(
|
| const std::string& search_query,
|
| + const GURL& next_feed,
|
| const SearchCallback& callback) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| scoped_ptr<std::vector<DocumentFeed*> > feed_list(
|
| @@ -2796,6 +2810,7 @@ void GDataFileSystem::SearchAsyncOnUIThread(
|
| // results (especially since we don't cache them).
|
| FilePath(), // Not used.
|
| search_query,
|
| + next_feed,
|
| std::string(), // No directory resource ID.
|
| FindEntryCallback(), // Not used.
|
| base::Bind(&GDataFileSystem::OnSearch,
|
|
|