OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 // TODO(kochi): Further split gdata_operations.h and include only necessary | 10 // TODO(kochi): Further split gdata_operations.h and include only necessary |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 protected: | 57 protected: |
58 virtual ~DriveServiceObserver() {} | 58 virtual ~DriveServiceObserver() {} |
59 }; | 59 }; |
60 | 60 |
61 // Callback used for GetResourceList(). | 61 // Callback used for GetResourceList(). |
62 typedef base::Callback<void(GDataErrorCode error, | 62 typedef base::Callback<void(GDataErrorCode error, |
63 scoped_ptr<ResourceList> resource_list)> | 63 scoped_ptr<ResourceList> resource_list)> |
64 GetResourceListCallback; | 64 GetResourceListCallback; |
65 | 65 |
| 66 // Callback used for GetResourceEntry(). |
| 67 typedef base::Callback<void(GDataErrorCode error, |
| 68 scoped_ptr<ResourceEntry> entry)> |
| 69 GetResourceEntryCallback; |
| 70 |
66 // This defines an interface for sharing by DriveService and MockDriveService | 71 // This defines an interface for sharing by DriveService and MockDriveService |
67 // so that we can do testing of clients of DriveService. | 72 // so that we can do testing of clients of DriveService. |
68 // | 73 // |
69 // All functions must be called on UI thread. DriveService is built on top of | 74 // All functions must be called on UI thread. DriveService is built on top of |
70 // URLFetcher that runs on UI thread. | 75 // URLFetcher that runs on UI thread. |
71 class DriveServiceInterface { | 76 class DriveServiceInterface { |
72 public: | 77 public: |
73 virtual ~DriveServiceInterface() {} | 78 virtual ~DriveServiceInterface() {} |
74 | 79 |
75 // Common service: | 80 // Common service: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 const std::string& search_query, | 133 const std::string& search_query, |
129 bool shared_with_me, | 134 bool shared_with_me, |
130 const std::string& directory_resource_id, | 135 const std::string& directory_resource_id, |
131 const GetResourceListCallback& callback) = 0; | 136 const GetResourceListCallback& callback) = 0; |
132 | 137 |
133 // Fetches single entry metadata from server. The entry's resource id equals | 138 // Fetches single entry metadata from server. The entry's resource id equals |
134 // |resource_id|. | 139 // |resource_id|. |
135 // Upon completion, invokes |callback| with results on the calling thread. | 140 // Upon completion, invokes |callback| with results on the calling thread. |
136 // |callback| must not be null. | 141 // |callback| must not be null. |
137 virtual void GetResourceEntry(const std::string& resource_id, | 142 virtual void GetResourceEntry(const std::string& resource_id, |
138 const GetDataCallback& callback) = 0; | 143 const GetResourceEntryCallback& callback) = 0; |
139 | 144 |
140 // Gets the account metadata from the server using the default account | 145 // Gets the account metadata from the server using the default account |
141 // metadata URL. Upon completion, invokes |callback| with results on the | 146 // metadata URL. Upon completion, invokes |callback| with results on the |
142 // calling thread. | 147 // calling thread. |
143 // |callback| must not be null. | 148 // |callback| must not be null. |
144 virtual void GetAccountMetadata(const GetDataCallback& callback) = 0; | 149 virtual void GetAccountMetadata(const GetDataCallback& callback) = 0; |
145 | 150 |
146 // Gets the application information from the server. | 151 // Gets the application information from the server. |
147 // Upon completion, invokes |callback| with results on the calling thread. | 152 // Upon completion, invokes |callback| with results on the calling thread. |
148 // |callback| must not be null. | 153 // |callback| must not be null. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Upon completion, invokes |callback| with results on the calling thread. | 246 // Upon completion, invokes |callback| with results on the calling thread. |
242 // |callback| must not be null. | 247 // |callback| must not be null. |
243 virtual void AuthorizeApp(const GURL& edit_url, | 248 virtual void AuthorizeApp(const GURL& edit_url, |
244 const std::string& app_id, | 249 const std::string& app_id, |
245 const GetDataCallback& callback) = 0; | 250 const GetDataCallback& callback) = 0; |
246 }; | 251 }; |
247 | 252 |
248 } // namespace google_apis | 253 } // namespace google_apis |
249 | 254 |
250 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 255 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
OLD | NEW |