summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/drive/document_entry_conversion.h28
-rw-r--r--chrome/browser/chromeos/drive/drive_api_service.cc22
-rw-r--r--chrome/browser/chromeos/drive/drive_api_service.h18
-rw-r--r--chrome/browser/chromeos/drive/drive_feed_loader.cc38
-rw-r--r--chrome/browser/chromeos/drive/drive_feed_loader.h19
-rw-r--r--chrome/browser/chromeos/drive/drive_feed_processor.cc8
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system.cc24
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system.h10
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_interface.h4
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_unittest.cc100
-rw-r--r--chrome/browser/chromeos/drive/drive_resource_metadata.cc10
-rw-r--r--chrome/browser/chromeos/drive/drive_resource_metadata.h6
-rw-r--r--chrome/browser/chromeos/drive/drive_scheduler.cc8
-rw-r--r--chrome/browser/chromeos/drive/drive_scheduler.h22
-rw-r--r--chrome/browser/chromeos/drive/drive_scheduler_unittest.cc42
-rw-r--r--chrome/browser/chromeos/drive/file_system/copy_operation.cc34
-rw-r--r--chrome/browser/chromeos/drive/file_system/copy_operation.h20
-rw-r--r--chrome/browser/chromeos/drive/file_system/remove_operation.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system/remove_operation.h2
-rw-r--r--chrome/browser/chromeos/drive/file_system/update_operation.cc4
-rw-r--r--chrome/browser/chromeos/drive/file_system/update_operation.h2
-rw-r--r--chrome/browser/chromeos/drive/mock_drive_file_system.h2
-rw-r--r--chrome/browser/chromeos/drive/resource_entry_conversion.cc (renamed from chrome/browser/chromeos/drive/document_entry_conversion.cc)6
-rw-r--r--chrome/browser/chromeos/drive/resource_entry_conversion.h22
-rw-r--r--chrome/browser/chromeos/drive/resource_entry_conversion_unittest.cc (renamed from chrome/browser/chromeos/drive/document_entry_conversion_unittest.cc)48
-rw-r--r--chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc2
-rw-r--r--chrome/browser/chromeos/extensions/external_filesystem_apitest.cc44
27 files changed, 271 insertions, 276 deletions
diff --git a/chrome/browser/chromeos/drive/document_entry_conversion.h b/chrome/browser/chromeos/drive/document_entry_conversion.h
deleted file mode 100644
index afa157e..0000000
--- a/chrome/browser/chromeos/drive/document_entry_conversion.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DOCUMENT_ENTRY_CONVERSION_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_DOCUMENT_ENTRY_CONVERSION_H_
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-
-class GURL;
-
-namespace google_apis {
-class DocumentEntry;
-}
-
-namespace drive {
-
-class DriveEntryProto;
-
-// Converts a google_apis::DocumentEntry into a DriveEntryProto.
-DriveEntryProto ConvertDocumentEntryToDriveEntryProto(
- const google_apis::DocumentEntry& document_entry);
-
-} // namespace drive
-
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_DOCUMENT_ENTRY_CONVERSION_H_
diff --git a/chrome/browser/chromeos/drive/drive_api_service.cc b/chrome/browser/chromeos/drive/drive_api_service.cc
index 9234e92..152aacc 100644
--- a/chrome/browser/chromeos/drive/drive_api_service.cc
+++ b/chrome/browser/chromeos/drive/drive_api_service.cc
@@ -93,7 +93,7 @@ DriveAPIService::GetProgressStatusList() const {
return operation_registry()->GetProgressStatusList();
}
-void DriveAPIService::GetDocuments(
+void DriveAPIService::GetResourceList(
const GURL& url,
int64 start_changestamp,
const std::string& search_query,
@@ -143,7 +143,7 @@ void DriveAPIService::GetChangelist(
callback));
}
-void DriveAPIService::GetDocumentEntry(
+void DriveAPIService::GetResourceEntry(
const std::string& resource_id,
const google_apis::GetDataCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -178,10 +178,10 @@ void DriveAPIService::GetApplicationInfo(
callback));
}
-void DriveAPIService::DownloadDocument(
+void DriveAPIService::DownloadHostedDocument(
const FilePath& virtual_path,
const FilePath& local_cache_path,
- const GURL& document_url,
+ const GURL& content_url,
google_apis::DocumentExportFormat format,
const google_apis::DownloadActionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -194,7 +194,7 @@ void DriveAPIService::DownloadDocument(
void DriveAPIService::DownloadFile(
const FilePath& virtual_path,
const FilePath& local_cache_path,
- const GURL& document_url,
+ const GURL& content_url,
const google_apis::DownloadActionCallback& download_action_callback,
const google_apis::GetContentCallback& get_content_callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -205,8 +205,8 @@ void DriveAPIService::DownloadFile(
NOTREACHED();
}
-void DriveAPIService::DeleteDocument(
- const GURL& document_url,
+void DriveAPIService::DeleteResource(
+ const GURL& edit_url,
const google_apis::EntryActionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -226,7 +226,7 @@ void DriveAPIService::AddNewDirectory(
NOTREACHED();
}
-void DriveAPIService::CopyDocument(
+void DriveAPIService::CopyHostedDocument(
const std::string& resource_id,
const FilePath::StringType& new_name,
const google_apis::GetDataCallback& callback) {
@@ -238,7 +238,7 @@ void DriveAPIService::CopyDocument(
}
void DriveAPIService::RenameResource(
- const GURL& resource_url,
+ const GURL& edit_url,
const FilePath::StringType& new_name,
const google_apis::EntryActionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -250,7 +250,7 @@ void DriveAPIService::RenameResource(
void DriveAPIService::AddResourceToDirectory(
const GURL& parent_content_url,
- const GURL& resource_url,
+ const GURL& edit_url,
const google_apis::EntryActionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -291,7 +291,7 @@ void DriveAPIService::ResumeUpload(
}
void DriveAPIService::AuthorizeApp(
- const GURL& resource_url,
+ const GURL& edit_url,
const std::string& app_ids,
const google_apis::GetDataCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
diff --git a/chrome/browser/chromeos/drive/drive_api_service.h b/chrome/browser/chromeos/drive/drive_api_service.h
index b1ed7eea..50bc5c5 100644
--- a/chrome/browser/chromeos/drive/drive_api_service.h
+++ b/chrome/browser/chromeos/drive/drive_api_service.h
@@ -58,14 +58,14 @@ class DriveAPIService : public google_apis::DriveServiceInterface,
const OVERRIDE;
virtual bool HasAccessToken() const OVERRIDE;
virtual bool HasRefreshToken() const OVERRIDE;
- virtual void GetDocuments(
+ virtual void GetResourceList(
const GURL& feed_url,
int64 start_changestamp,
const std::string& search_query,
bool shared_with_me,
const std::string& directory_resource_id,
const google_apis::GetDataCallback& callback) OVERRIDE;
- virtual void GetDocumentEntry(
+ virtual void GetResourceEntry(
const std::string& resource_id,
const google_apis::GetDataCallback& callback) OVERRIDE;
@@ -73,10 +73,10 @@ class DriveAPIService : public google_apis::DriveServiceInterface,
const google_apis::GetDataCallback& callback) OVERRIDE;
virtual void GetApplicationInfo(
const google_apis::GetDataCallback& callback) OVERRIDE;
- virtual void DeleteDocument(
- const GURL& document_url,
+ virtual void DeleteResource(
+ const GURL& edit_url,
const google_apis::EntryActionCallback& callback) OVERRIDE;
- virtual void DownloadDocument(
+ virtual void DownloadHostedDocument(
const FilePath& virtual_path,
const FilePath& local_cache_path,
const GURL& content_url,
@@ -88,17 +88,17 @@ class DriveAPIService : public google_apis::DriveServiceInterface,
const GURL& content_url,
const google_apis::DownloadActionCallback& download_action_callback,
const google_apis::GetContentCallback& get_content_callback) OVERRIDE;
- virtual void CopyDocument(
+ virtual void CopyHostedDocument(
const std::string& resource_id,
const FilePath::StringType& new_name,
const google_apis::GetDataCallback& callback) OVERRIDE;
virtual void RenameResource(
- const GURL& document_url,
+ const GURL& edit_url,
const FilePath::StringType& new_name,
const google_apis::EntryActionCallback& callback) OVERRIDE;
virtual void AddResourceToDirectory(
const GURL& parent_content_url,
- const GURL& resource_url,
+ const GURL& edit_url,
const google_apis::EntryActionCallback& callback) OVERRIDE;
virtual void RemoveResourceFromDirectory(
const GURL& parent_content_url,
@@ -115,7 +115,7 @@ class DriveAPIService : public google_apis::DriveServiceInterface,
const google_apis::ResumeUploadParams& params,
const google_apis::ResumeUploadCallback& callback) OVERRIDE;
virtual void AuthorizeApp(
- const GURL& resource_url,
+ const GURL& edit_url,
const std::string& app_id,
const google_apis::GetDataCallback& callback) OVERRIDE;
diff --git a/chrome/browser/chromeos/drive/drive_feed_loader.cc b/chrome/browser/chromeos/drive/drive_feed_loader.cc
index f1cf3ce..b13f21e 100644
--- a/chrome/browser/chromeos/drive/drive_feed_loader.cc
+++ b/chrome/browser/chromeos/drive/drive_feed_loader.cc
@@ -182,7 +182,7 @@ struct DriveFeedLoader::LoadFeedParams {
bool load_subsequent_feeds;
const LoadFeedListCallback feed_load_callback;
ScopedVector<google_apis::DocumentFeed> feed_list;
- scoped_ptr<GetDocumentsUiState> ui_state;
+ scoped_ptr<GetResourceListUiState> ui_state;
};
// Defines set of parameters sent to callback OnProtoLoaded().
@@ -228,8 +228,8 @@ struct DriveFeedLoader::UpdateMetadataParams {
// the current update state. In order to make users comfortable,
// we increment the number of fetched documents with more frequent but smaller
// steps than actual fetching.
-struct DriveFeedLoader::GetDocumentsUiState {
- explicit GetDocumentsUiState(base::TimeTicks start_time)
+struct DriveFeedLoader::GetResourceListUiState {
+ explicit GetResourceListUiState(base::TimeTicks start_time)
: num_fetched_documents(0),
num_showing_documents(0),
start_time(start_time),
@@ -248,7 +248,7 @@ struct DriveFeedLoader::GetDocumentsUiState {
// Time elapsed since the feed fetching was started.
base::TimeDelta feed_fetching_elapsed_time;
- base::WeakPtrFactory<GetDocumentsUiState> weak_ptr_factory;
+ base::WeakPtrFactory<GetResourceListUiState> weak_ptr_factory;
};
DriveFeedLoader::DriveFeedLoader(
@@ -405,7 +405,7 @@ void DriveFeedLoader::LoadFromServer(scoped_ptr<LoadFeedParams> params) {
// base::Passed() may get evaluated first, so get a pointer to params.
LoadFeedParams* params_ptr = params.get();
if (google_apis::util::IsDriveV2ApiEnabled()) {
- scheduler_->GetDocuments(
+ scheduler_->GetResourceList(
params_ptr->feed_to_load,
params_ptr->start_changestamp,
std::string(), // No search query.
@@ -416,13 +416,13 @@ void DriveFeedLoader::LoadFromServer(scoped_ptr<LoadFeedParams> params) {
base::Passed(&params),
start_time));
} else {
- scheduler_->GetDocuments(
+ scheduler_->GetResourceList(
params_ptr->feed_to_load,
params_ptr->start_changestamp,
params_ptr->search_query,
params_ptr->shared_with_me,
params_ptr->directory_resource_id,
- base::Bind(&DriveFeedLoader::OnGetDocuments,
+ base::Bind(&DriveFeedLoader::OnGetResourceList,
weak_ptr_factory_.GetWeakPtr(),
base::Passed(&params),
start_time));
@@ -477,10 +477,10 @@ void DriveFeedLoader::UpdateMetadataFromFeedAfterLoadFromServer(
params.callback));
}
-void DriveFeedLoader::OnGetDocuments(scoped_ptr<LoadFeedParams> params,
- base::TimeTicks start_time,
- google_apis::GDataErrorCode status,
- scoped_ptr<base::Value> data) {
+void DriveFeedLoader::OnGetResourceList(scoped_ptr<LoadFeedParams> params,
+ base::TimeTicks start_time,
+ google_apis::GDataErrorCode status,
+ scoped_ptr<base::Value> data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (params->feed_list.empty()) {
@@ -536,9 +536,9 @@ void DriveFeedLoader::OnParseFeed(
// Check if we need to collect more data to complete the directory list.
if (has_next_feed_url && !next_feed_url.is_empty()) {
// Post an UI update event to make the UI smoother.
- GetDocumentsUiState* ui_state = params->ui_state.get();
+ GetResourceListUiState* ui_state = params->ui_state.get();
if (ui_state == NULL) {
- ui_state = new GetDocumentsUiState(base::TimeTicks::Now());
+ ui_state = new GetResourceListUiState(base::TimeTicks::Now());
params->ui_state.reset(ui_state);
}
DCHECK(ui_state);
@@ -559,13 +559,13 @@ void DriveFeedLoader::OnParseFeed(
// pointer so we can use it bellow.
LoadFeedParams* params_ptr = params.get();
// Kick off the remaining part of the feeds.
- scheduler_->GetDocuments(
+ scheduler_->GetResourceList(
next_feed_url,
params_ptr->start_changestamp,
params_ptr->search_query,
params_ptr->shared_with_me,
params_ptr->directory_resource_id,
- base::Bind(&DriveFeedLoader::OnGetDocuments,
+ base::Bind(&DriveFeedLoader::OnGetResourceList,
weak_ptr_factory_.GetWeakPtr(),
base::Passed(&params),
start_time));
@@ -640,9 +640,9 @@ void DriveFeedLoader::OnGetChangelist(scoped_ptr<LoadFeedParams> params,
// Check if we need to collect more data to complete the directory list.
if (has_next_feed) {
// Post an UI update event to make the UI smoother.
- GetDocumentsUiState* ui_state = params->ui_state.get();
+ GetResourceListUiState* ui_state = params->ui_state.get();
if (ui_state == NULL) {
- ui_state = new GetDocumentsUiState(base::TimeTicks::Now());
+ ui_state = new GetResourceListUiState(base::TimeTicks::Now());
params->ui_state.reset(ui_state);
}
DCHECK(ui_state);
@@ -662,7 +662,7 @@ void DriveFeedLoader::OnGetChangelist(scoped_ptr<LoadFeedParams> params,
// Kick off the remaining part of the feeds.
// Extract the pointer so we can use it bellow.
LoadFeedParams* params_ptr = params.get();
- scheduler_->GetDocuments(
+ scheduler_->GetResourceList(
current_feed->next_link(),
params_ptr->start_changestamp,
std::string(), // No search query.
@@ -687,7 +687,7 @@ void DriveFeedLoader::OnGetChangelist(scoped_ptr<LoadFeedParams> params,
}
void DriveFeedLoader::OnNotifyDocumentFeedFetched(
- base::WeakPtr<GetDocumentsUiState> ui_state) {
+ base::WeakPtr<GetResourceListUiState> ui_state) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!ui_state) {
diff --git a/chrome/browser/chromeos/drive/drive_feed_loader.h b/chrome/browser/chromeos/drive/drive_feed_loader.h
index 4df78d6..af2d2e9 100644
--- a/chrome/browser/chromeos/drive/drive_feed_loader.h
+++ b/chrome/browser/chromeos/drive/drive_feed_loader.h
@@ -99,7 +99,7 @@ class DriveFeedLoader {
bool refreshing() const { return refreshing_; }
private:
- struct GetDocumentsUiState;
+ struct GetResourceListUiState;
struct LoadFeedParams;
struct LoadRootFeedParams;
struct UpdateMetadataParams;
@@ -138,20 +138,20 @@ class DriveFeedLoader {
const ScopedVector<google_apis::DocumentFeed>& feed_list,
DriveFileError error);
- // Callback for handling response from |GDataWapiService::GetDocuments|.
+ // Callback for handling response from |GDataWapiService::GetResourceList|.
// Invokes |callback| when done.
// |callback| must not be null.
- void OnGetDocuments(scoped_ptr<LoadFeedParams> params,
- base::TimeTicks start_time,
- google_apis::GDataErrorCode status,
- scoped_ptr<base::Value> data);
+ void OnGetResourceList(scoped_ptr<LoadFeedParams> params,
+ base::TimeTicks start_time,
+ google_apis::GDataErrorCode status,
+ scoped_ptr<base::Value> data);
// Callback for handling results of feed parse.
void OnParseFeed(scoped_ptr<LoadFeedParams> params,
base::TimeTicks start_time,
scoped_ptr<google_apis::DocumentFeed> current_feed);
- // Callback for handling response from |DriveAPIService::GetDocuments|.
+ // Callback for handling response from |DriveAPIService::GetResourceList|.
// Invokes |callback| when done.
// |callback| must not be null.
void OnGetChangelist(scoped_ptr<LoadFeedParams> params,
@@ -162,8 +162,9 @@ class DriveFeedLoader {
// Save filesystem to disk.
void SaveFileSystem();
- // Callback for handling UI updates caused by document fetching.
- void OnNotifyDocumentFeedFetched(base::WeakPtr<GetDocumentsUiState> ui_state);
+ // Callback for handling UI updates caused by feed fetching.
+ void OnNotifyDocumentFeedFetched(
+ base::WeakPtr<GetResourceListUiState> ui_state);
// Callback for DriveFeedProcessor::ApplyFeeds.
void NotifyDirectoryChanged(bool should_notify,
diff --git a/chrome/browser/chromeos/drive/drive_feed_processor.cc b/chrome/browser/chromeos/drive/drive_feed_processor.cc
index 6e1fc1b..5caaff3 100644
--- a/chrome/browser/chromeos/drive/drive_feed_processor.cc
+++ b/chrome/browser/chromeos/drive/drive_feed_processor.cc
@@ -5,10 +5,10 @@
#include <utility>
#include "base/metrics/histogram.h"
-#include "chrome/browser/chromeos/drive/document_entry_conversion.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/drive_feed_processor.h"
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
+#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -305,7 +305,7 @@ void DriveFeedProcessor::FeedToEntryProtoMap(
const google_apis::DocumentFeed* feed = feed_list[i];
// Get upload url from the root feed. Links for all other collections will
- // be handled in ConvertDocumentEntryToDriveEntryProto.
+ // be handled in ConvertResourceEntryToDriveEntryProto.
if (i == 0) {
const google_apis::Link* root_feed_upload_link = feed->GetLinkByType(
google_apis::Link::LINK_RESUMABLE_CREATE_MEDIA);
@@ -317,8 +317,8 @@ void DriveFeedProcessor::FeedToEntryProtoMap(
}
for (size_t j = 0; j < feed->entries().size(); ++j) {
- const google_apis::DocumentEntry* doc = feed->entries()[j];
- DriveEntryProto entry_proto = ConvertDocumentEntryToDriveEntryProto(*doc);
+ const google_apis::ResourceEntry* doc = feed->entries()[j];
+ DriveEntryProto entry_proto = ConvertResourceEntryToDriveEntryProto(*doc);
// Some document entries don't map into files (i.e. sites).
if (entry_proto.resource_id().empty())
continue;
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc
index 38a087a3..c1955059 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -14,7 +14,6 @@
#include "base/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/values.h"
-#include "chrome/browser/chromeos/drive/document_entry_conversion.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/drive_cache.h"
#include "chrome/browser/chromeos/drive/drive_feed_loader.h"
@@ -25,6 +24,7 @@
#include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
#include "chrome/browser/chromeos/drive/file_system/move_operation.h"
#include "chrome/browser/chromeos/drive/file_system/remove_operation.h"
+#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/drive_api_util.h"
#include "chrome/browser/google_apis/drive_service_interface.h"
@@ -959,14 +959,14 @@ void DriveFileSystem::OnGetFileFromCache(
// - if we have enough space, start downloading the file from the server
GetFileFromCacheParams params(in_params);
params.cache_file_path = cache_file_path;
- drive_service_->GetDocumentEntry(
+ drive_service_->GetResourceEntry(
params.resource_id,
- base::Bind(&DriveFileSystem::OnGetDocumentEntry,
+ base::Bind(&DriveFileSystem::OnGetResourceEntry,
ui_weak_ptr_,
params));
}
-void DriveFileSystem::OnGetDocumentEntry(const GetFileFromCacheParams& params,
+void DriveFileSystem::OnGetResourceEntry(const GetFileFromCacheParams& params,
google_apis::GDataErrorCode status,
scoped_ptr<base::Value> data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -981,13 +981,13 @@ void DriveFileSystem::OnGetDocumentEntry(const GetFileFromCacheParams& params,
return;
}
- scoped_ptr<google_apis::DocumentEntry> doc_entry;
+ scoped_ptr<google_apis::ResourceEntry> doc_entry;
if (!google_apis::util::IsDriveV2ApiEnabled()) {
- doc_entry = google_apis::DocumentEntry::ExtractAndParse(*data);
+ doc_entry = google_apis::ResourceEntry::ExtractAndParse(*data);
} else {
scoped_ptr<google_apis::FileResource> file_resource =
google_apis::FileResource::CreateFrom(*data);
- doc_entry = google_apis::DocumentEntry::CreateFromFileResource(
+ doc_entry = google_apis::ResourceEntry::CreateFromFileResource(
*file_resource);
}
@@ -1376,8 +1376,8 @@ void DriveFileSystem::AddNewDirectory(
resource_metadata_->AddEntryToDirectory(
params.created_directory_path.DirName(),
- scoped_ptr<google_apis::DocumentEntry>(
- google_apis::DocumentEntry::ExtractAndParse(*data)),
+ scoped_ptr<google_apis::ResourceEntry>(
+ google_apis::ResourceEntry::ExtractAndParse(*data)),
base::Bind(&DriveFileSystem::ContinueCreateDirectory,
ui_weak_ptr_,
params));
@@ -1440,7 +1440,7 @@ void DriveFileSystem::OnSearch(
const base::Closure callback = base::Bind(
search_callback, DRIVE_FILE_OK, next_feed, base::Passed(&result_vec));
- const ScopedVector<google_apis::DocumentEntry>& entries = feed->entries();
+ const ScopedVector<google_apis::ResourceEntry>& entries = feed->entries();
if (entries.empty()) {
callback.Run();
return;
@@ -1453,7 +1453,7 @@ void DriveFileSystem::OnSearch(
// Run the callback if this is the last iteration of the loop.
const bool should_run_callback = (i + 1 == entries.size());
resource_metadata_->RefreshEntryProto(
- ConvertDocumentEntryToDriveEntryProto(*entries[i]),
+ ConvertResourceEntryToDriveEntryProto(*entries[i]),
base::Bind(&DriveFileSystem::AddToSearchResults,
ui_weak_ptr_,
results,
@@ -1775,7 +1775,7 @@ void DriveFileSystem::ContinueFindFirstMissingParentDirectory(
void DriveFileSystem::AddUploadedFile(
const FilePath& directory_path,
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const FilePath& file_content_path,
const FileOperationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
diff --git a/chrome/browser/chromeos/drive/drive_file_system.h b/chrome/browser/chromeos/drive/drive_file_system.h
index 9cbf598..ab529bc 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.h
+++ b/chrome/browser/chromeos/drive/drive_file_system.h
@@ -129,7 +129,7 @@ class DriveFileSystem : public DriveFileSystemInterface,
virtual void GetAvailableSpace(
const GetAvailableSpaceCallback& callback) OVERRIDE;
virtual void AddUploadedFile(const FilePath& directory_path,
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const FilePath& file_content_path,
const FileOperationCallback& callback) OVERRIDE;
virtual DriveFileSystemMetadata GetMetadata() const OVERRIDE;
@@ -426,16 +426,16 @@ class DriveFileSystem : public DriveFileSystemInterface,
DriveFileError error,
const FilePath& cache_file_path);
- // Callback for |drive_service_->GetDocumentEntry|.
- // It is called before file download. If GetDocumentEntry was successful,
+ // Callback for |drive_service_->GetResourceEntry|.
+ // It is called before file download. If GetResourceEntry was successful,
// file download procedure is started for the file. The file is downloaded
// from the content url extracted from the fetched metadata.
- void OnGetDocumentEntry(const GetFileFromCacheParams& params,
+ void OnGetResourceEntry(const GetFileFromCacheParams& params,
google_apis::GDataErrorCode status,
scoped_ptr<base::Value> data);
// Check available space using file size from the fetched metadata. Called
- // from OnGetDocumentEntry after RefreshFile is complete.
+ // from OnGetResourceEntry after RefreshFile is complete.
void CheckForSpaceBeforeDownload(
const GetFileFromCacheParams& params,
int64 file_size,
diff --git a/chrome/browser/chromeos/drive/drive_file_system_interface.h b/chrome/browser/chromeos/drive/drive_file_system_interface.h
index b7e0b29..d726dcc8f 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_interface.h
+++ b/chrome/browser/chromeos/drive/drive_file_system_interface.h
@@ -14,7 +14,7 @@
#include "chrome/browser/google_apis/gdata_wapi_operations.h"
namespace google_apis {
-class DocumentEntry;
+class ResourceEntry;
}
namespace drive {
@@ -335,7 +335,7 @@ class DriveFileSystemInterface {
// |callback| will be called on the UI thread upon completion of operation.
// |callback| must not be null.
virtual void AddUploadedFile(const FilePath& directory_path,
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const FilePath& file_content_path,
const FileOperationCallback& callback) = 0;
diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
index 57e49dd..02c509d 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
@@ -83,21 +83,21 @@ void DriveSearchCallback(
}
// Action used to set mock expectations for
-// DriveServiceInterface::GetDocumentEntry().
-ACTION_P2(MockGetDocumentEntry, status, value) {
+// DriveServiceInterface::GetResourceEntry().
+ACTION_P2(MockGetResourceEntry, status, value) {
base::MessageLoopProxy::current()->PostTask(FROM_HERE,
base::Bind(arg1, status, base::Passed(value)));
}
// Action used to set mock expectations for
-// DriveFileSystem::CopyDocument().
-ACTION_P2(MockCopyDocument, status, value) {
+// DriveFileSystem::CopyHostedDocument().
+ACTION_P2(MockCopyHostedDocument, status, value) {
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
base::Bind(arg2, status, base::Passed(value)));
}
-ACTION(MockFailingGetDocuments) {
+ACTION(MockFailingGetResourceList) {
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
base::Bind(arg5, google_apis::GDATA_NO_CONNECTION,
@@ -140,8 +140,8 @@ class FakeDriveUploader : public google_apis::DriveUploaderInterface {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/uploaded_file.json");
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
@@ -149,7 +149,7 @@ class FakeDriveUploader : public google_apis::DriveUploaderInterface {
google_apis::DRIVE_UPLOAD_OK,
drive_file_path,
local_file_path,
- base::Passed(&document_entry)));
+ base::Passed(&resource_entry)));
const int kUploadId = 123;
return kUploadId;
@@ -185,10 +185,10 @@ class FakeDriveUploader : public google_apis::DriveUploaderInterface {
DCHECK_EQ("drive/File 1.txt", drive_file_path.value());
const std::string kResourceId = "file:2_file_resource_id";
- // Create a google_apis::DocumentEntry, which is needed to return a value
+ // Create a google_apis::ResourceEntry, which is needed to return a value
// from this function. TODO(satorux): This should be cleaned
// up. crbug.com/134240.
- scoped_ptr<google_apis::DocumentEntry> document_entry;
+ scoped_ptr<google_apis::ResourceEntry> resource_entry;
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/root_feed.json");
if (!value.get())
@@ -204,11 +204,11 @@ class FakeDriveUploader : public google_apis::DriveUploaderInterface {
if (entry_list->GetDictionary(i, &entry) &&
entry->GetString("gd$resourceId.$t", &resource_id) &&
resource_id == kResourceId) {
- document_entry = google_apis::DocumentEntry::CreateFrom(*entry);
+ resource_entry = google_apis::ResourceEntry::CreateFrom(*entry);
}
}
}
- if (!document_entry)
+ if (!resource_entry)
return -1;
base::MessageLoopProxy::current()->PostTask(
@@ -217,7 +217,7 @@ class FakeDriveUploader : public google_apis::DriveUploaderInterface {
google_apis::DRIVE_UPLOAD_OK,
drive_file_path,
local_file_path,
- base::Passed(&document_entry)));
+ base::Passed(&resource_entry)));
const int kUploadId = 123;
return kUploadId;
@@ -372,7 +372,7 @@ class DriveFileSystemTest : public testing::Test {
bool RemoveEntry(const FilePath& file_path) {
DriveFileError error;
- EXPECT_CALL(*mock_drive_service_, DeleteDocument(_, _)).Times(AnyNumber());
+ EXPECT_CALL(*mock_drive_service_, DeleteResource(_, _)).Times(AnyNumber());
file_system_->Remove(
file_path, false,
base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error));
@@ -644,10 +644,10 @@ class DriveFileSystemTest : public testing::Test {
}
}
- void SetExpectationsForGetDocumentEntry(scoped_ptr<base::Value>* document,
+ void SetExpectationsForGetResourceEntry(scoped_ptr<base::Value>* document,
const std::string& resource_id) {
- EXPECT_CALL(*mock_drive_service_, GetDocumentEntry(resource_id, _))
- .WillOnce(MockGetDocumentEntry(google_apis::HTTP_SUCCESS, document));
+ EXPECT_CALL(*mock_drive_service_, GetResourceEntry(resource_id, _))
+ .WillOnce(MockGetResourceEntry(google_apis::HTTP_SUCCESS, document));
}
// Loads serialized proto file from GCache, and makes sure the root
@@ -909,7 +909,7 @@ TEST_F(DriveFileSystemTest, DuplicatedAsyncInitialization) {
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(Eq(GURL()), _, _, _, _, _)).Times(1);
+ GetResourceList(Eq(GURL()), _, _, _, _, _)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
@@ -1248,11 +1248,11 @@ TEST_F(DriveFileSystemTest, CachedFeedLoadingThenServerFeedLoading) {
SaveTestFileSystem(USE_SERVER_TIMESTAMP);
// SaveTestFileSystem and "account_metadata.json" have the same changestamp,
- // so no request for new feeds (i.e., call to GetDocuments) should happen.
+ // so no request for new feeds (i.e., call to GetResourceList) should happen.
// Account metadata is already set up in MockDriveService's constructor.
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
- EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _, _)).Times(0);
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(_, _, _, _, _, _)).Times(0);
// Kicks loading of cached file system and query for server update.
EXPECT_TRUE(EntryExists(FilePath(FILE_PATH_LITERAL("drive/File1"))));
@@ -1277,10 +1277,10 @@ TEST_F(DriveFileSystemTest, OfflineCachedFeedLoading) {
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
- // Make GetDocuments fail for simulating offline situation. This will leave
+ // Make GetResourceList fail for simulating offline situation. This will leave
// the file system "loaded from cache, but not synced with server" state.
- EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _, _))
- .WillOnce(MockFailingGetDocuments());
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(_, _, _, _, _, _))
+ .WillOnce(MockFailingGetResourceList());
// Kicks loading of cached file system and query for server update.
EXPECT_TRUE(EntryExists(FilePath(FILE_PATH_LITERAL("drive/File1"))));
@@ -1293,7 +1293,7 @@ TEST_F(DriveFileSystemTest, OfflineCachedFeedLoading) {
"gdata/account_metadata.json").release());
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
- EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _, _)).Times(1);
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(_, _, _, _, _, _)).Times(1);
file_system_->CheckForUpdates();
// Expected value from reading gdata/basic_feed.json.
@@ -1330,8 +1330,8 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_RegularFile) {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
// Transfer the local file to Drive.
file_system_->TransferFileFromLocalToRemote(
@@ -1369,15 +1369,15 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_HostedDocument) {
EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
- // We'll copy a hosted document using CopyDocument.
+ // We'll copy a hosted document using CopyHostedDocument.
// ".gdoc" suffix should be stripped when copying.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/uploaded_document.json");
EXPECT_CALL(*mock_drive_service_,
- CopyDocument(kResourceId,
- FILE_PATH_LITERAL("Document 1"),
- _))
- .WillOnce(MockCopyDocument(google_apis::HTTP_SUCCESS, &document));
+ CopyHostedDocument(kResourceId,
+ FILE_PATH_LITERAL("Document 1"),
+ _))
+ .WillOnce(MockCopyHostedDocument(google_apis::HTTP_SUCCESS, &document));
// We'll then add the hosted document to the destination directory.
EXPECT_CALL(*mock_drive_service_,
AddResourceToDirectory(_, _, _)).Times(1);
@@ -1427,7 +1427,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_RegularFile) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService.
EXPECT_CALL(*mock_drive_service_,
@@ -2043,7 +2043,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpace) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService.
EXPECT_CALL(*mock_drive_service_,
@@ -2084,7 +2084,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoSpaceAtAll) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is not obtained with the mock DriveService, because of no space.
EXPECT_CALL(*mock_drive_service_,
@@ -2140,7 +2140,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoEnoughSpaceButCanFreeUp) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService, because of we freed up the
// space.
@@ -2193,7 +2193,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpaceButBecomeFull) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService.
EXPECT_CALL(*mock_drive_service_,
@@ -2237,7 +2237,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromCache) {
DriveCache::CACHE_TYPE_TMP);
// Make sure we don't fetch metadata for downloading file.
- EXPECT_CALL(*mock_drive_service_, GetDocumentEntry(_, _)).Times(0);
+ EXPECT_CALL(*mock_drive_service_, GetResourceEntry(_, _)).Times(0);
// Make sure we don't call downloads at all.
EXPECT_CALL(*mock_drive_service_,
@@ -2300,7 +2300,7 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService, because it's not stored in
// the cache.
@@ -2494,10 +2494,10 @@ TEST_F(DriveFileSystemTest, ContentSearch) {
mock_drive_service_->set_search_result("gdata/search_result_feed.json");
- // There should be only one GetDocuments request, even though search result
+ // There should be only one GetResourceList request, even though search result
// feed has next feed url.
- EXPECT_CALL(*mock_drive_service_, GetDocuments(Eq(GURL()), _, "foo", _, _, _))
- .Times(1);
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(Eq(GURL()), _, "foo", _, _,
+ _)).Times(1);
const SearchResultPair kExpectedResults[] = {
{ "drive/Directory 1/SubDirectory File 1.txt", false },
@@ -2522,10 +2522,10 @@ TEST_F(DriveFileSystemTest, ContentSearchWithNewEntry) {
mock_drive_service_->set_search_result(
"gdata/search_result_with_new_entry_feed.json");
- // There should be only one GetDocuments request, even though search result
+ // There should be only one GetResourceList request, even though search result
// feed has next feed url.
- EXPECT_CALL(*mock_drive_service_, GetDocuments(Eq(GURL()), _, "foo", _, _, _))
- .Times(1);
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(Eq(GURL()), _, "foo", _, _,
+ _)).Times(1);
// As the result of the first Search(), only entries in the current file
// system snapshot are expected to be returned.
@@ -2537,7 +2537,7 @@ TEST_F(DriveFileSystemTest, ContentSearchWithNewEntry) {
// This will cause notification to observers (e.g., File Browser) so that
// they can request search again.
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
- EXPECT_CALL(*mock_drive_service_, GetDocuments(Eq(GURL()), _, "", _, _, _))
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(Eq(GURL()), _, "", _, _, _))
.Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
@@ -2568,8 +2568,8 @@ TEST_F(DriveFileSystemTest, ContentSearchEmptyResult) {
mock_drive_service_->set_search_result("gdata/empty_feed.json");
- EXPECT_CALL(*mock_drive_service_, GetDocuments(Eq(GURL()), _, "foo", _, _, _))
- .Times(1);
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(Eq(GURL()), _, "foo", _, _,
+ _)).Times(1);
const SearchResultPair* expected_results = NULL;
@@ -2601,8 +2601,8 @@ TEST_F(DriveFileSystemTest, RequestDirectoryRefresh) {
// kWAPIRootDirectoryResourceIdForTesting
// is used here as the root ID is set in DriveFeedLoader::UpdateFromFeed().
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(Eq(GURL()), _, _, _, kWAPIRootDirectoryResourceId,
- _))
+ GetResourceList(Eq(GURL()), _, _, _, kWAPIRootDirectoryResourceId,
+ _))
.Times(1);
// We'll notify the directory change to the observer.
EXPECT_CALL(*mock_directory_observer_,
@@ -2647,7 +2647,7 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
// We will read content url from the result.
scoped_ptr<base::Value> document =
google_apis::test_util::LoadJSONFile("gdata/document_to_download.json");
- SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
+ SetExpectationsForGetResourceEntry(&document, "file:2_file_resource_id");
// The file is obtained with the mock DriveService.
EXPECT_CALL(*mock_drive_service_,
diff --git a/chrome/browser/chromeos/drive/drive_resource_metadata.cc b/chrome/browser/chromeos/drive/drive_resource_metadata.cc
index f7d54c0..01f8720 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata.cc
@@ -11,9 +11,9 @@
#include "base/sequenced_task_runner.h"
#include "base/string_number_conversions.h"
#include "base/tracked_objects.h"
-#include "chrome/browser/chromeos/drive/document_entry_conversion.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/drive_files.h"
+#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
#include "chrome/browser/google_apis/time_util.h"
#include "content/public/browser/browser_thread.h"
@@ -236,7 +236,7 @@ void DriveResourceMetadata::ClearRoot() {
void DriveResourceMetadata::AddEntryToDirectory(
const FilePath& directory_path,
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const FileMoveCallback& callback) {
DCHECK(!directory_path.empty());
DCHECK(!callback.is_null());
@@ -260,7 +260,7 @@ void DriveResourceMetadata::AddEntryToDirectory(
AddEntryToDirectoryInternal(
directory,
- ConvertDocumentEntryToDriveEntryProto(*doc_entry),
+ ConvertResourceEntryToDriveEntryProto(*doc_entry),
callback);
}
@@ -499,7 +499,7 @@ void DriveResourceMetadata::GetEntryInfoPairByPaths(
}
void DriveResourceMetadata::RefreshFile(
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const GetEntryInfoWithFilePathCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -510,7 +510,7 @@ void DriveResourceMetadata::RefreshFile(
return;
}
- RefreshEntryProto(ConvertDocumentEntryToDriveEntryProto(
+ RefreshEntryProto(ConvertResourceEntryToDriveEntryProto(
*doc_entry), callback);
}
diff --git a/chrome/browser/chromeos/drive/drive_resource_metadata.h b/chrome/browser/chromeos/drive/drive_resource_metadata.h
index 326534a..f52408c 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata.h
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata.h
@@ -22,7 +22,7 @@ class SequencedTaskRunner;
}
namespace google_apis {
-class DocumentEntry;
+class ResourceEntry;
}
namespace drive {
@@ -152,7 +152,7 @@ class DriveResourceMetadata {
// callback asynchronously.
// |callback| must not be null.
void AddEntryToDirectory(const FilePath& directory_path,
- scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ scoped_ptr<google_apis::ResourceEntry> doc_entry,
const FileMoveCallback& callback);
// Add |entry_proto| to the metadata tree, based on its parent_resource_id.
@@ -215,7 +215,7 @@ class DriveResourceMetadata {
// with |doc_entry|.
// |callback| must not be null.
// TODO(achuith): Deprecate this in favor of RefreshEntryProto above.
- void RefreshFile(scoped_ptr<google_apis::DocumentEntry> doc_entry,
+ void RefreshFile(scoped_ptr<google_apis::ResourceEntry> doc_entry,
const GetEntryInfoWithFilePathCallback& callback);
// Removes all child files of |directory| and replaces them with
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc
index 3e55b50..78f6521 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler.cc
@@ -122,7 +122,7 @@ void DriveScheduler::Copy(const FilePath& src_file_path,
StartJobLoop();
}
-void DriveScheduler::GetDocuments(
+void DriveScheduler::GetResourceList(
const GURL& feed_url,
int64 start_changestamp,
const std::string& search_query,
@@ -133,7 +133,7 @@ void DriveScheduler::GetDocuments(
DCHECK(!callback.is_null());
scoped_ptr<QueueEntry> new_job(
- new QueueEntry(TYPE_GET_DOCUMENTS, FilePath()));
+ new QueueEntry(TYPE_GET_RESOURCE_LIST, FilePath()));
new_job->feed_url = feed_url;
new_job->start_changestamp = start_changestamp;
new_job->search_query = search_query;
@@ -297,8 +297,8 @@ void DriveScheduler::DoJobLoop() {
}
break;
- case TYPE_GET_DOCUMENTS: {
- drive_service_->GetDocuments(
+ case TYPE_GET_RESOURCE_LIST: {
+ drive_service_->GetResourceList(
queue_entry->feed_url,
queue_entry->start_changestamp,
queue_entry->search_query,
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.h b/chrome/browser/chromeos/drive/drive_scheduler.h
index 5f8c2ba..2fd5393 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.h
+++ b/chrome/browser/chromeos/drive/drive_scheduler.h
@@ -36,7 +36,7 @@ class DriveScheduler
TYPE_GET_ACCOUNT_METADATA,
TYPE_GET_APPLICATION_INFO,
TYPE_COPY,
- TYPE_GET_DOCUMENTS,
+ TYPE_GET_RESOURCE_LIST,
TYPE_MOVE,
TYPE_REMOVE,
TYPE_TRANSFER_LOCAL_TO_REMOTE,
@@ -102,14 +102,14 @@ class DriveScheduler
const FilePath& dest_file_path,
const FileOperationCallback& callback);
- // Adds a GetDocuments operation to the queue.
+ // Adds a GetResourceList operation to the queue.
// |callback| must not be null.
- void GetDocuments(const GURL& feed_url,
- int64 start_changestamp,
- const std::string& search_query,
- bool shared_with_me,
- const std::string& directory_resource_id,
- const google_apis::GetDataCallback& callback);
+ void GetResourceList(const GURL& feed_url,
+ int64 start_changestamp,
+ const std::string& search_query,
+ bool shared_with_me,
+ const std::string& directory_resource_id,
+ const google_apis::GetDataCallback& callback);
// Adds a transfer operation to the queue.
// |callback| must not be null.
@@ -176,9 +176,9 @@ class DriveScheduler
// TYPE_REMOVE
bool is_recursive;
- // Parameters for GetDocuments().
+ // Parameters for GetResourceList().
// Used by:
- // TYPE_GET_DOCUMENTS
+ // TYPE_GET_RESOURCE_LIST
GURL feed_url;
int64 start_changestamp;
std::string search_query;
@@ -189,7 +189,7 @@ class DriveScheduler
// Used by:
// TYPE_GET_ACCOUNT_METADATA,
// TYPE_GET_APPLICATION_INFO,
- // TYPE_GET_DOCUMENTS
+ // TYPE_GET_RESOURCE_LIST
google_apis::GetDataCallback get_data_callback;
};
diff --git a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
index b9929f8..b0a94c6 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc
@@ -62,12 +62,12 @@ class FakeDriveService : public DriveServiceInterface {
return true;
}
- virtual void GetDocuments(const GURL& feed_url,
- int64 start_changestamp,
- const std::string& search_query,
- bool shared_with_me,
- const std::string& directory_resource_id,
- const GetDataCallback& callback) {
+ virtual void GetResourceList(const GURL& feed_url,
+ int64 start_changestamp,
+ const std::string& search_query,
+ bool shared_with_me,
+ const std::string& directory_resource_id,
+ const GetDataCallback& callback) {
// TODO: Make this more flexible.
if (feed_url == GURL("http://example.com/gdata/root_feed.json")) {
// Make some sample data.
@@ -91,7 +91,7 @@ class FakeDriveService : public DriveServiceInterface {
}
}
- virtual void GetDocumentEntry(const std::string& resource_id,
+ virtual void GetResourceEntry(const std::string& resource_id,
const GetDataCallback& callback) {
}
@@ -113,29 +113,29 @@ class FakeDriveService : public DriveServiceInterface {
GetAccountMetadata(callback);
}
- virtual void DeleteDocument(const GURL& document_url,
+ virtual void DeleteResource(const GURL& edit_url,
const EntryActionCallback& callback) {
}
- virtual void DownloadDocument(const FilePath& virtual_path,
- const FilePath& local_cache_path,
- const GURL& content_url,
- DocumentExportFormat format,
- const DownloadActionCallback& callback) {
+ virtual void DownloadHostedDocument(const FilePath& virtual_path,
+ const FilePath& local_cache_path,
+ const GURL& content_url,
+ DocumentExportFormat format,
+ const DownloadActionCallback& callback) {
}
- virtual void CopyDocument(const std::string& resource_id,
- const FilePath::StringType& new_name,
- const GetDataCallback& callback) {
+ virtual void CopyHostedDocument(const std::string& resource_id,
+ const FilePath::StringType& new_name,
+ const GetDataCallback& callback) {
}
- virtual void RenameResource(const GURL& resource_url,
+ virtual void RenameResource(const GURL& edit_url,
const FilePath::StringType& new_name,
const EntryActionCallback& callback) {
}
virtual void AddResourceToDirectory(const GURL& parent_content_url,
- const GURL& resource_url,
+ const GURL& edit_url,
const EntryActionCallback& callback) {
}
@@ -166,7 +166,7 @@ class FakeDriveService : public DriveServiceInterface {
const ResumeUploadCallback& callback) {
}
- virtual void AuthorizeApp(const GURL& resource_url,
+ virtual void AuthorizeApp(const GURL& edit_url,
const std::string& app_id,
const GetDataCallback& callback) {
}
@@ -425,13 +425,13 @@ TEST_F(DriveSchedulerTest, GetAccountMetadata) {
}
-TEST_F(DriveSchedulerTest, GetDocuments) {
+TEST_F(DriveSchedulerTest, GetResourceList) {
ConnectToWifi();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
scoped_ptr<base::Value> value;
- scheduler_->GetDocuments(
+ scheduler_->GetResourceList(
GURL("http://example.com/gdata/root_feed.json"),
0,
std::string(),
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.cc b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
index d6a83ed..914f5aa2 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
@@ -20,7 +20,7 @@
#include "net/base/mime_util.h"
using content::BrowserThread;
-using google_apis::DocumentEntry;
+using google_apis::ResourceEntry;
using google_apis::GDataErrorCode;
namespace drive {
@@ -64,7 +64,7 @@ DriveFileError GetLocalFileInfoOnBlockingPool(
std::string GetDocumentResourceIdOnBlockingPool(
const FilePath& local_file_path) {
std::string result;
- if (DocumentEntry::HasHostedDocumentExtension(local_file_path)) {
+ if (ResourceEntry::HasHostedDocumentExtension(local_file_path)) {
std::string error;
DictionaryValue* dict_value = NULL;
JSONFileValueSerializer serializer(local_file_path);
@@ -212,7 +212,7 @@ void CopyOperation::TransferRegularFile(
base::Owned(content_type)));
}
-void CopyOperation::CopyDocumentToDirectory(
+void CopyOperation::CopyHostedDocumentToDirectory(
const FilePath& dir_path,
const std::string& resource_id,
const FilePath::StringType& new_name,
@@ -220,16 +220,16 @@ void CopyOperation::CopyDocumentToDirectory(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- drive_service_->CopyDocument(
+ drive_service_->CopyHostedDocument(
resource_id,
new_name,
- base::Bind(&CopyOperation::OnCopyDocumentCompleted,
+ base::Bind(&CopyOperation::OnCopyHostedDocumentCompleted,
weak_ptr_factory_.GetWeakPtr(),
dir_path,
callback));
}
-void CopyOperation::OnCopyDocumentCompleted(
+void CopyOperation::OnCopyHostedDocumentCompleted(
const FilePath& dir_path,
const FileOperationCallback& callback,
GDataErrorCode status,
@@ -248,7 +248,7 @@ void CopyOperation::OnCopyDocumentCompleted(
// destination directory by MoveEntryFromRootDirectory().
metadata_->AddEntryToDirectory(
FilePath(kDriveRootDirectory),
- scoped_ptr<DocumentEntry>(DocumentEntry::ExtractAndParse(*data)),
+ scoped_ptr<ResourceEntry>(ResourceEntry::ExtractAndParse(*data)),
base::Bind(&CopyOperation::MoveEntryFromRootDirectory,
weak_ptr_factory_.GetWeakPtr(),
dir_path,
@@ -379,12 +379,12 @@ void CopyOperation::CopyAfterGetEntryInfoPair(
}
if (src_file_proto->file_specific_info().is_hosted_document()) {
- CopyDocumentToDirectory(dest_file_path.DirName(),
- src_file_proto->resource_id(),
- // Drop the document extension, which should not be
- // in the document title.
- dest_file_path.BaseName().RemoveExtension().value(),
- callback);
+ CopyHostedDocumentToDirectory(
+ dest_file_path.DirName(),
+ src_file_proto->resource_id(),
+ // Drop the document extension, which should not be in the title.
+ dest_file_path.BaseName().RemoveExtension().value(),
+ callback);
return;
}
@@ -484,13 +484,13 @@ void CopyOperation::OnTransferCompleted(
google_apis::DriveUploadError error,
const FilePath& drive_path,
const FilePath& file_path,
- scoped_ptr<DocumentEntry> document_entry) {
+ scoped_ptr<ResourceEntry> resource_entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- if (error == google_apis::DRIVE_UPLOAD_OK && document_entry.get()) {
+ if (error == google_apis::DRIVE_UPLOAD_OK && resource_entry.get()) {
drive_file_system_->AddUploadedFile(drive_path.DirName(),
- document_entry.Pass(),
+ resource_entry.Pass(),
file_path,
callback);
} else {
@@ -546,7 +546,7 @@ void CopyOperation::TransferFileForResourceId(
// Otherwise, copy the document on the server side and add the new copy
// to the destination directory (collection).
- CopyDocumentToDirectory(
+ CopyHostedDocumentToDirectory(
remote_dest_file_path.DirName(),
resource_id,
// Drop the document extension, which should not be
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.h b/chrome/browser/chromeos/drive/file_system/copy_operation.h
index 8aa1380..8fe36a2 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation.h
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation.h
@@ -104,22 +104,22 @@ class CopyOperation {
const std::string& unused_mime_type,
DriveFileType file_type);
- // Copies a document with |resource_id| to the directory at |dir_path|
+ // Copies a hosted document with |resource_id| to the directory at |dir_path|
// and names the copied document as |new_name|.
//
// Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null.
- void CopyDocumentToDirectory(const FilePath& dir_path,
- const std::string& resource_id,
- const FilePath::StringType& new_name,
- const FileOperationCallback& callback);
+ void CopyHostedDocumentToDirectory(const FilePath& dir_path,
+ const std::string& resource_id,
+ const FilePath::StringType& new_name,
+ const FileOperationCallback& callback);
// Callback for handling document copy attempt.
// |callback| must not be null.
- void OnCopyDocumentCompleted(const FilePath& dir_path,
- const FileOperationCallback& callback,
- google_apis::GDataErrorCode status,
- scoped_ptr<base::Value> data);
+ void OnCopyHostedDocumentCompleted(const FilePath& dir_path,
+ const FileOperationCallback& callback,
+ google_apis::GDataErrorCode status,
+ scoped_ptr<base::Value> data);
// Moves a file or directory at |file_path| in the root directory to
// another directory at |dir_path|. This function does nothing if
@@ -194,7 +194,7 @@ class CopyOperation {
google_apis::DriveUploadError error,
const FilePath& drive_path,
const FilePath& file_path,
- scoped_ptr<google_apis::DocumentEntry> document_entry);
+ scoped_ptr<google_apis::ResourceEntry> resource_entry);
// Part of TransferFileFromLocalToRemote(). Called after
// GetEntryInfoByPath() is complete.
diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.cc b/chrome/browser/chromeos/drive/file_system/remove_operation.cc
index aae5c1f..58d7afd 100644
--- a/chrome/browser/chromeos/drive/file_system/remove_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/remove_operation.cc
@@ -73,7 +73,7 @@ void RemoveOperation::RemoveAfterGetEntryInfo(
return;
}
- drive_service_->DeleteDocument(
+ drive_service_->DeleteResource(
GURL(entry_proto->edit_url()),
base::Bind(&RemoveOperation::RemoveResourceLocally,
weak_ptr_factory_.GetWeakPtr(),
diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.h b/chrome/browser/chromeos/drive/file_system/remove_operation.h
index 3054ceb..8149d61a 100644
--- a/chrome/browser/chromeos/drive/file_system/remove_operation.h
+++ b/chrome/browser/chromeos/drive/file_system/remove_operation.h
@@ -54,7 +54,7 @@ class RemoveOperation {
DriveFileError error,
scoped_ptr<DriveEntryProto> entry_proto);
- // Callback for DriveServiceInterface::DeleteDocument. Removes the entry with
+ // Callback for DriveServiceInterface::DeleteResource. Removes the entry with
// |resource_id| from the local snapshot of the filesystem and the cache.
// |callback| must not be null.
void RemoveResourceLocally(
diff --git a/chrome/browser/chromeos/drive/file_system/update_operation.cc b/chrome/browser/chromeos/drive/file_system/update_operation.cc
index 4e06288..d0741bf 100644
--- a/chrome/browser/chromeos/drive/file_system/update_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/update_operation.cc
@@ -145,7 +145,7 @@ void UpdateOperation::OnUpdatedFileUploaded(
google_apis::DriveUploadError error,
const FilePath& drive_path,
const FilePath& file_path,
- scoped_ptr<google_apis::DocumentEntry> document_entry) {
+ scoped_ptr<google_apis::ResourceEntry> resource_entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -156,7 +156,7 @@ void UpdateOperation::OnUpdatedFileUploaded(
}
metadata_->RefreshFile(
- document_entry.Pass(),
+ resource_entry.Pass(),
base::Bind(&UpdateOperation::OnUpdatedFileRefreshed,
weak_ptr_factory_.GetWeakPtr(), callback));
}
diff --git a/chrome/browser/chromeos/drive/file_system/update_operation.h b/chrome/browser/chromeos/drive/file_system/update_operation.h
index 0349a5e..135d474 100644
--- a/chrome/browser/chromeos/drive/file_system/update_operation.h
+++ b/chrome/browser/chromeos/drive/file_system/update_operation.h
@@ -91,7 +91,7 @@ class UpdateOperation {
google_apis::DriveUploadError error,
const FilePath& gdata_path,
const FilePath& file_path,
- scoped_ptr<google_apis::DocumentEntry> document_entry);
+ scoped_ptr<google_apis::ResourceEntry> resource_entry);
// Part of UpdateFileByResourceId().
// |callback| must not be null.
diff --git a/chrome/browser/chromeos/drive/mock_drive_file_system.h b/chrome/browser/chromeos/drive/mock_drive_file_system.h
index f1b32c8..44a3800 100644
--- a/chrome/browser/chromeos/drive/mock_drive_file_system.h
+++ b/chrome/browser/chromeos/drive/mock_drive_file_system.h
@@ -93,7 +93,7 @@ class MockDriveFileSystem : public DriveFileSystemInterface {
void(const GetAvailableSpaceCallback& callback));
// This function is not mockable by gmock because scoped_ptr is not supported.
virtual void AddUploadedFile(const FilePath& file,
- scoped_ptr<google_apis::DocumentEntry> entry,
+ scoped_ptr<google_apis::ResourceEntry> entry,
const FilePath& file_content_path,
const FileOperationCallback& callback) OVERRIDE {
}
diff --git a/chrome/browser/chromeos/drive/document_entry_conversion.cc b/chrome/browser/chromeos/drive/resource_entry_conversion.cc
index eb730a0..4ae904b 100644
--- a/chrome/browser/chromeos/drive/document_entry_conversion.cc
+++ b/chrome/browser/chromeos/drive/resource_entry_conversion.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/drive/document_entry_conversion.h"
+#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -15,8 +15,8 @@
namespace drive {
-DriveEntryProto ConvertDocumentEntryToDriveEntryProto(
- const google_apis::DocumentEntry& doc) {
+DriveEntryProto ConvertResourceEntryToDriveEntryProto(
+ const google_apis::ResourceEntry& doc) {
DriveEntryProto entry_proto;
// For regular files, the 'filename' and 'title' attribute in the metadata
diff --git a/chrome/browser/chromeos/drive/resource_entry_conversion.h b/chrome/browser/chromeos/drive/resource_entry_conversion.h
new file mode 100644
index 0000000..eb51f22
--- /dev/null
+++ b/chrome/browser/chromeos/drive/resource_entry_conversion.h
@@ -0,0 +1,22 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
+#define CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
+
+namespace google_apis {
+class ResourceEntry;
+}
+
+namespace drive {
+
+class DriveEntryProto;
+
+// Converts a google_apis::ResourceEntry into a DriveEntryProto.
+DriveEntryProto ConvertResourceEntryToDriveEntryProto(
+ const google_apis::ResourceEntry& resource_entry);
+
+} // namespace drive
+
+#endif // CHROME_BROWSER_CHROMEOS_DRIVE_RESOURCE_ENTRY_CONVERSION_H_
diff --git a/chrome/browser/chromeos/drive/document_entry_conversion_unittest.cc b/chrome/browser/chromeos/drive/resource_entry_conversion_unittest.cc
index c85378e..b9fefda 100644
--- a/chrome/browser/chromeos/drive/document_entry_conversion_unittest.cc
+++ b/chrome/browser/chromeos/drive/resource_entry_conversion_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/drive/document_entry_conversion.h"
+#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "base/file_path.h"
#include "base/values.h"
@@ -14,17 +14,17 @@
namespace drive {
-TEST(DocumentEntryConversionTest, ConvertDocumentEntryToDriveEntryProto_File) {
+TEST(ResourceEntryConversionTest, ConvertResourceEntryToDriveEntryProto_File) {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/file_entry.json");
ASSERT_TRUE(value.get());
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
- ASSERT_TRUE(document_entry.get());
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
+ ASSERT_TRUE(resource_entry.get());
DriveEntryProto entry_proto =
- ConvertDocumentEntryToDriveEntryProto(*document_entry);
+ ConvertResourceEntryToDriveEntryProto(*resource_entry);
EXPECT_EQ("File 1.mp3", entry_proto.title());
EXPECT_EQ("File 1.mp3", entry_proto.base_name());
@@ -75,18 +75,18 @@ TEST(DocumentEntryConversionTest, ConvertDocumentEntryToDriveEntryProto_File) {
EXPECT_FALSE(entry_proto.file_info().is_directory());
}
-TEST(DocumentEntryConversionTest,
- ConvertDocumentEntryToDriveEntryProto_HostedDocument) {
+TEST(ResourceEntryConversionTest,
+ ConvertResourceEntryToDriveEntryProto_HostedDocument) {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/hosted_document_entry.json");
ASSERT_TRUE(value.get());
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
- ASSERT_TRUE(document_entry.get());
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
+ ASSERT_TRUE(resource_entry.get());
DriveEntryProto entry_proto =
- ConvertDocumentEntryToDriveEntryProto(*document_entry);
+ ConvertResourceEntryToDriveEntryProto(*resource_entry);
EXPECT_EQ("Document 1", entry_proto.title());
EXPECT_EQ("Document 1.gdoc", entry_proto.base_name()); // The suffix added.
@@ -159,18 +159,18 @@ TEST(DocumentEntryConversionTest,
EXPECT_FALSE(entry_proto.file_info().is_directory());
}
-TEST(DocumentEntryConversionTest,
- ConvertDocumentEntryToDriveEntryProto_Directory) {
+TEST(ResourceEntryConversionTest,
+ ConvertResourceEntryToDriveEntryProto_Directory) {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile("gdata/directory_entry.json");
ASSERT_TRUE(value.get());
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
- ASSERT_TRUE(document_entry.get());
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
+ ASSERT_TRUE(resource_entry.get());
DriveEntryProto entry_proto =
- ConvertDocumentEntryToDriveEntryProto(*document_entry);
+ ConvertResourceEntryToDriveEntryProto(*resource_entry);
EXPECT_EQ("Sub Directory Folder", entry_proto.title());
EXPECT_EQ("Sub Directory Folder", entry_proto.base_name());
@@ -236,19 +236,19 @@ TEST(DocumentEntryConversionTest,
EXPECT_TRUE(entry_proto.file_info().is_directory());
}
-TEST(DocumentEntryConversionTest,
- ConvertDocumentEntryToDriveEntryProto_DeletedHostedDocument) {
+TEST(ResourceEntryConversionTest,
+ ConvertResourceEntryToDriveEntryProto_DeletedHostedDocument) {
scoped_ptr<base::Value> value =
google_apis::test_util::LoadJSONFile(
"gdata/deleted_hosted_document_entry.json");
ASSERT_TRUE(value.get());
- scoped_ptr<google_apis::DocumentEntry> document_entry(
- google_apis::DocumentEntry::ExtractAndParse(*value));
- ASSERT_TRUE(document_entry.get());
+ scoped_ptr<google_apis::ResourceEntry> resource_entry(
+ google_apis::ResourceEntry::ExtractAndParse(*value));
+ ASSERT_TRUE(resource_entry.get());
DriveEntryProto entry_proto =
- ConvertDocumentEntryToDriveEntryProto(*document_entry);
+ ConvertResourceEntryToDriveEntryProto(*resource_entry);
EXPECT_EQ("Deleted document", entry_proto.title());
EXPECT_EQ("Deleted document.gdoc", entry_proto.base_name());
diff --git a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc
index 9496c83..320bed7 100644
--- a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc
+++ b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc
@@ -166,7 +166,7 @@ TEST_F(StaleCacheFilesRemoverTest, RemoveStaleCacheFiles) {
// Verify that the corresponding file entry doesn't exist.
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(2);
- EXPECT_CALL(*mock_drive_service_, GetDocuments(Eq(GURL()), _, "", _, _, _))
+ EXPECT_CALL(*mock_drive_service_, GetResourceList(Eq(GURL()), _, "", _, _, _))
.Times(2);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
diff --git a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
index 0efa08e..e09e69d 100644
--- a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
@@ -143,14 +143,14 @@ ACTION_P2(MockCreateDirectoryCallback, status, value) {
base::Bind(arg2, status, base::Passed(value)));
}
-// Action used to set mock expecteations for GetDocuments.
-ACTION_P2(MockGetDocumentsCallback, status, value) {
+// Action used to set mock expectations for GetResourceList.
+ACTION_P2(MockGetResourceListCallback, status, value) {
base::MessageLoopProxy::current()->PostTask(FROM_HERE,
base::Bind(arg5, status, base::Passed(value)));
}
-// Action used to mock expectations fo GetDocumentEntry.
-ACTION_P2(MockGetDocumentEntryCallback, status, value) {
+// Action used to mock expectations for GetResourceEntry.
+ACTION_P2(MockGetResourceEntryCallback, status, value) {
base::MessageLoopProxy::current()->PostTask(FROM_HERE,
base::Bind(arg1, status, base::Passed(value)));
}
@@ -390,9 +390,9 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest,
// Remote filesystem should first request root feed from gdata server.
scoped_ptr<base::Value> documents_value(LoadJSONFile(kTestRootFeed));
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(_, _, _, _, _, _))
- .WillOnce(MockGetDocumentsCallback(google_apis::HTTP_SUCCESS,
- &documents_value));
+ GetResourceList(_, _, _, _, _, _))
+ .WillOnce(MockGetResourceListCallback(google_apis::HTTP_SUCCESS,
+ &documents_value));
// When file browser tries to read the file, remote filesystem should detect
// that the cached file is not present on the disk and download it. Mocked
@@ -404,12 +404,12 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest,
scoped_ptr<base::Value> document_to_download_value(
LoadJSONFile(kTestDocumentToDownloadEntry));
EXPECT_CALL(*mock_drive_service_,
- GetDocumentEntry("file:1_file_resource_id", _))
- .WillOnce(MockGetDocumentEntryCallback(google_apis::HTTP_SUCCESS,
+ GetResourceEntry("file:1_file_resource_id", _))
+ .WillOnce(MockGetResourceEntryCallback(google_apis::HTTP_SUCCESS,
&document_to_download_value));
// We expect to download url defined in document entry returned by
- // GetDocumentEntry mock implementation.
+ // GetResourceEntry mock implementation.
EXPECT_CALL(*mock_drive_service_,
DownloadFile(_, _, GURL("https://file_content_url_changed"),
_, _))
@@ -430,9 +430,9 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, ContentSearch) {
// First, test will get drive root directory, to init file system.
scoped_ptr<base::Value> documents_value(LoadJSONFile(kTestRootFeed));
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(_, _, "", _, _, _))
- .WillOnce(MockGetDocumentsCallback(google_apis::HTTP_SUCCESS,
- &documents_value));
+ GetResourceList(_, _, "", _, _, _))
+ .WillOnce(MockGetResourceListCallback(google_apis::HTTP_SUCCESS,
+ &documents_value));
// Search results will be returned in two parts:
// 1. Search will be given empty initial feed url. The returned feed will
@@ -448,26 +448,26 @@ IN_PROC_BROWSER_TEST_F(RemoteFileSystemExtensionApiTest, ContentSearch) {
AddNextFeedURLToFeedValue("https://next_feed", first_search_value.get()));
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(GURL(), _, "foo", _, _, _))
- .WillOnce(MockGetDocumentsCallback(google_apis::HTTP_SUCCESS,
- &first_search_value));
+ GetResourceList(GURL(), _, "foo", _, _, _))
+ .WillOnce(MockGetResourceListCallback(google_apis::HTTP_SUCCESS,
+ &first_search_value));
scoped_ptr<base::Value> second_search_value(LoadJSONFile(kTestRootFeed));
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(GURL("https://next_feed"), _, "foo", _, _, _))
- .WillOnce(MockGetDocumentsCallback(google_apis::HTTP_SUCCESS,
- &second_search_value));
+ GetResourceList(GURL("https://next_feed"), _, "foo", _, _, _))
+ .WillOnce(MockGetResourceListCallback(google_apis::HTTP_SUCCESS,
+ &second_search_value));
// Test will try to create a snapshot of the returned file.
scoped_ptr<base::Value> document_to_download_value(
LoadJSONFile(kTestDocumentToDownloadEntry));
EXPECT_CALL(*mock_drive_service_,
- GetDocumentEntry("file:1_file_resource_id", _))
- .WillOnce(MockGetDocumentEntryCallback(google_apis::HTTP_SUCCESS,
+ GetResourceEntry("file:1_file_resource_id", _))
+ .WillOnce(MockGetResourceEntryCallback(google_apis::HTTP_SUCCESS,
&document_to_download_value));
// We expect to download url defined in document entry returned by
- // GetDocumentEntry mock implementation.
+ // GetResourceEntry mock implementation.
EXPECT_CALL(*mock_drive_service_,
DownloadFile(_, _, GURL("https://file_content_url_changed"),
_, _))