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

Side by Side Diff: chrome/browser/chromeos/gdata/drive_api_service.h

Issue 10829375: Cleanup: separate WAPI and Drive API code in gdata_documents_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_SERVICE_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/chromeos/gdata/documents_service_interface.h"
13 #include "chrome/browser/chromeos/gdata/gdata_operations.h"
14 #include "chrome/browser/chromeos/gdata/gdata_auth_service.h"
15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h"
16
17 class FilePath;
18 class GURL;
19 class Profile;
20
21 namespace gdata {
22
23 class GDataOperationRunner;
24
25 // This class provides documents feed service calls.
26 // TODO(kochi): rewrite this comment.
27 class DriveAPIService : public DocumentsServiceInterface {
28 public:
29 // Instance is usually created by GDataSystemServiceFactory and owned by
30 // GDataFileSystem.
31 DriveAPIService();
32 virtual ~DriveAPIService();
33
34 // DocumentsServiceInterface Overrides
35 virtual void Initialize(Profile* profile) OVERRIDE;
36 virtual GDataOperationRegistry* operation_registry() const OVERRIDE;
37 virtual void CancelAll() OVERRIDE;
38 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE;
39 virtual void GetDocuments(const GURL& feed_url,
40 int64 start_changestamp,
41 const std::string& search_query,
42 const std::string& directory_resource_id,
43 const GetDataCallback& callback) OVERRIDE;
44 virtual void GetDocumentEntry(const std::string& resource_id,
45 const GetDataCallback& callback) OVERRIDE;
46
47 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE;
48 virtual void GetApplicationInfo(const GetDataCallback& callback) OVERRIDE;
49 virtual void DeleteDocument(const GURL& document_url,
50 const EntryActionCallback& callback) OVERRIDE;
51 virtual void DownloadDocument(
52 const FilePath& virtual_path,
53 const FilePath& local_cache_path,
54 const GURL& content_url,
55 DocumentExportFormat format,
56 const DownloadActionCallback& callback) OVERRIDE;
57 virtual void DownloadFile(
58 const FilePath& virtual_path,
59 const FilePath& local_cache_path,
60 const GURL& content_url,
61 const DownloadActionCallback& download_action_callback,
62 const GetContentCallback& get_content_callback) OVERRIDE;
63 virtual void CopyDocument(const std::string& resource_id,
64 const FilePath::StringType& new_name,
65 const GetDataCallback& callback) OVERRIDE;
66 virtual void RenameResource(const GURL& document_url,
67 const FilePath::StringType& new_name,
68 const EntryActionCallback& callback) OVERRIDE;
69 virtual void AddResourceToDirectory(
70 const GURL& parent_content_url,
71 const GURL& resource_url,
72 const EntryActionCallback& callback) OVERRIDE;
73 virtual void RemoveResourceFromDirectory(
74 const GURL& parent_content_url,
75 const GURL& resource_url,
76 const std::string& resource_id,
77 const EntryActionCallback& callback) OVERRIDE;
78 virtual void CreateDirectory(const GURL& parent_content_url,
79 const FilePath::StringType& directory_name,
80 const GetDataCallback& callback) OVERRIDE;
81 virtual void InitiateUpload(const InitiateUploadParams& params,
82 const InitiateUploadCallback& callback) OVERRIDE;
83 virtual void ResumeUpload(const ResumeUploadParams& params,
84 const ResumeUploadCallback& callback) OVERRIDE;
85 virtual void AuthorizeApp(const GURL& resource_url,
86 const std::string& app_id,
87 const GetDataCallback& callback) OVERRIDE;
88 virtual bool HasAccessToken() const OVERRIDE;
89 virtual bool HasRefreshToken() const OVERRIDE;
90
91 // Fetches a changelist from |url| with |start_changestamp|, using Drive V2
92 // API. If this URL is empty the call will use the default URL. Specify |url|
93 // when pagenated request should be issued.
94 // |start_changestamp| specifies the starting point of change list or 0 if
95 // all changes are necessary.
96 // Upon completion, invokes |callback| with results on calling thread.
97 virtual void GetChangelist(const GURL& url,
98 int64 start_changestamp,
99 const GetDataCallback& callback);
100
101 // Fetches a filelist from |url| with |search_query|, using Drive V2 API. If
102 // this URL is empty the call will use the default URL. Specify |url| when
103 // pagenated request should be issued.
104 // |search_query| specifies query string, whose syntax is described at
105 // https://developers.google.com/drive/search-parameters
106 virtual void GetFilelist(const GURL& url,
107 const std::string& search_query,
108 const GetDataCallback& callback);
109
110 private:
111 Profile* profile_;
112
113 scoped_ptr<GDataOperationRunner> runner_;
114
115 DISALLOW_COPY_AND_ASSIGN(DriveAPIService);
116 };
117
118 } // namespace gdata
119
120 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698