Remove parent* arg from GDataEntry ctor.

* Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry.
* Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry.
* Add GDataDirectoryService::FromDocumentEntry and use this everywhere.
* Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and
CreateGDataDirectory. Make GDataEntry ctor protected.

BUG=141494
TEST=unit tests.
Review URL: https://chromiumcodereview.appspot.com/10854083

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
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(
      new std::vector<DocumentFeed*>);

  ContentOrigin initial_origin = directory_service_->origin();
  feed_loader_->LoadFromServer(
      initial_origin,
      0, 0,  // We don't use change stamps when fetching search
      false,  // Stop fetching search results after first feed
      FilePath(),  // Not used.
      search_query,
      next_feed,
      std::string(),  // No directory resource ID.
      FindEntryCallback(),  // Not used.
      base::Bind(&GDataFileSystem::OnSearch, ui_weak_ptr_, 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(
      new std::vector<DocumentFeed*>);

  ContentOrigin initial_origin = directory_service_->origin();
  feed_loader_->LoadFromServer(
      initial_origin,
      0, 0,  // We don't use change stamps when fetching search
      false,  // Stop fetching search results after first feed
      FilePath(),  // Not used.
      search_query,
      next_feed,
      std::string(),  // No directory resource ID.
      FindEntryCallback(),  // Not used.
      base::Bind(&GDataFileSystem::OnSearch, ui_weak_ptr_, callback));
}
