Index: chrome/browser/chromeos/gdata/gdata.h |
=================================================================== |
--- chrome/browser/chromeos/gdata/gdata.h (revision 126358) |
+++ chrome/browser/chromeos/gdata/gdata.h (working copy) |
@@ -177,7 +177,6 @@ |
} |
private: |
- |
// Helper function for StartAuthentication() call. |
void StartAuthenticationOnUIThread( |
GDataOperationRegistry* registry, |
@@ -199,6 +198,9 @@ |
// This defines an interface for sharing by DocumentService and |
// MockDocumentService so that we can do testing of clients of DocumentService. |
+// |
+// TODO(zel,benchan): Make the terminology/naming convention (e.g. file vs |
+// document vs resource, directory vs collection) more consistent and precise. |
class DocumentsServiceInterface { |
public: |
virtual ~DocumentsServiceInterface() {} |
@@ -239,6 +241,48 @@ |
DocumentExportFormat format, |
const DownloadActionCallback& callback) = 0; |
+ // Makes a copy of a document identified by its 'self' link |document_url|. |
+ // The copy is named as the UTF-8 encoded |new_name| and is not added to any |
+ // collection. Use AddResourceToDirectory() to add the copy to a collection |
+ // when needed. Upon completion, invokes |callback| with results on the |
+ // calling thread. |
+ // |
+ // Can be called on any thread. |
+ virtual void CopyDocument(const GURL& document_url, |
+ const FilePath::StringType& new_name, |
+ const GetDataCallback& callback) = 0; |
+ |
+ // Renames a document or collection identified by its 'self' link |
+ // |document_url| to the UTF-8 encoded |new_name|. Upon completion, |
+ // invokes |callback| with results on the calling thread. |
+ // |
+ // Can be called on any thread. |
+ virtual void RenameResource(const GURL& resource_url, |
+ const FilePath::StringType& new_name, |
+ const EntryActionCallback& callback) = 0; |
+ |
+ // Adds a resource (document, file, or collection) identified by its |
+ // 'self' link |resource_url| to a collection with a content link |
+ // |parent_content_url|. Upon completion, invokes |callback| with |
+ // results on the calling thread. |
+ // |
+ // Can be called on any thread. |
+ virtual void AddResourceToDirectory(const GURL& parent_content_url, |
+ const GURL& resource_url, |
+ const EntryActionCallback& callback) = 0; |
+ |
+ // Removes a resource (document, file, collection) identified by its |
+ // 'self' link |resource_url| from a collection with a content link |
+ // |parent_content_url|. Upon completion, invokes |callback| with |
+ // results on the calling thread. |
+ // |
+ // Can be called on any thread. |
+ virtual void RemoveResourceFromDirectory( |
+ const GURL& parent_content_url, |
+ const GURL& resource_url, |
+ const std::string& resource_id, |
+ const EntryActionCallback& callback) = 0; |
+ |
// Creates new collection with |directory_name| under parent directory |
// identified with |parent_content_url|. If |parent_content_url| is empty, |
// the new collection will be created in the root. Upon completion, |
@@ -290,6 +334,21 @@ |
const GURL& content_url, |
DocumentExportFormat format, |
const DownloadActionCallback& callback) OVERRIDE; |
+ virtual void CopyDocument(const GURL& document_url, |
+ const FilePath::StringType& new_name, |
+ const GetDataCallback& callback) OVERRIDE; |
+ virtual void RenameResource(const GURL& document_url, |
+ const FilePath::StringType& new_name, |
+ const EntryActionCallback& callback) OVERRIDE; |
+ virtual void AddResourceToDirectory( |
+ const GURL& parent_content_url, |
+ const GURL& resource_url, |
+ const EntryActionCallback& callback) OVERRIDE; |
+ virtual void RemoveResourceFromDirectory( |
+ const GURL& parent_content_url, |
+ const GURL& resource_url, |
+ const std::string& resource_id, |
+ const EntryActionCallback& callback) OVERRIDE; |
virtual void CreateDirectory(const GURL& parent_content_url, |
const FilePath::StringType& directory_name, |
const GetDataCallback& callback) OVERRIDE; |