| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 virtual void ClearAccessToken() = 0; | 124 virtual void ClearAccessToken() = 0; |
| 125 | 125 |
| 126 // Clears OAuth2 refresh token. | 126 // Clears OAuth2 refresh token. |
| 127 virtual void ClearRefreshToken() = 0; | 127 virtual void ClearRefreshToken() = 0; |
| 128 | 128 |
| 129 // Document access: | 129 // Document access: |
| 130 | 130 |
| 131 // Returns the resource id for the root directory. | 131 // Returns the resource id for the root directory. |
| 132 virtual std::string GetRootResourceId() const = 0; | 132 virtual std::string GetRootResourceId() const = 0; |
| 133 | 133 |
| 134 // This method is being deprecated. One of GetAllResourceList, |
| 135 // GetResourceListInDirectory, Search, SearchInDirectory, GetChangeList |
| 136 // should be used after they are implemented. |
| 137 // |
| 134 // Fetches a resource list or a change list from |url|. If this URL is | 138 // Fetches a resource list or a change list from |url|. If this URL is |
| 135 // empty, the call will fetch from the default URL. When | 139 // empty, the call will fetch from the default URL. When |
| 136 // |start_changestamp| is 0, the default behavior is to fetch the resource | 140 // |start_changestamp| is 0, the default behavior is to fetch the resource |
| 137 // list containing the list of all entries. If |start_changestamp| > 0, the | 141 // list containing the list of all entries. If |start_changestamp| > 0, the |
| 138 // default is to fetch the change list containing the updates from the | 142 // default is to fetch the change list containing the updates from the |
| 139 // specified changestamp. | 143 // specified changestamp. |
| 140 // | 144 // |
| 141 // |search_query| specifies search query to be sent to the server. It will be | 145 // |search_query| specifies search query to be sent to the server. It will be |
| 142 // used only if |start_changestamp| is 0. If empty string is passed, | 146 // used only if |start_changestamp| is 0. If empty string is passed, |
| 143 // |search_query| is ignored. | 147 // |search_query| is ignored. |
| 144 // | 148 // |
| 145 // |directory_resource_id| specifies the directory from which documents are | 149 // |directory_resource_id| specifies the directory from which documents are |
| 146 // fetched. It will be used only if |start_changestamp| is 0. If empty | 150 // fetched. It will be used only if |start_changestamp| is 0. If empty |
| 147 // string is passed, |directory_resource_id| is ignored. | 151 // string is passed, |directory_resource_id| is ignored. |
| 148 // | 152 // |
| 149 // Upon completion, invokes |callback| with results on the calling thread. | 153 // Upon completion, invokes |callback| with results on the calling thread. |
| 150 // TODO(haruki): Refactor this function: crbug.com/160932 | 154 // TODO(haruki): Refactor this function: crbug.com/160932 |
| 151 // |callback| must not be null. | 155 // |callback| must not be null. |
| 152 virtual void GetResourceList(const GURL& url, | 156 virtual void GetResourceList(const GURL& url, |
| 153 int64 start_changestamp, | 157 int64 start_changestamp, |
| 154 const std::string& search_query, | 158 const std::string& search_query, |
| 155 bool shared_with_me, | 159 bool shared_with_me, |
| 156 const std::string& directory_resource_id, | 160 const std::string& directory_resource_id, |
| 157 const GetResourceListCallback& callback) = 0; | 161 const GetResourceListCallback& callback) = 0; |
| 158 | 162 |
| 163 // Fetches a resource list of the account. |callback| will be called upon |
| 164 // completion. |
| 165 // If the list is too long, it may be paged. In such a case, a URL to fetch |
| 166 // remaining results will be included in the returned result. See also |
| 167 // ContinueGetResourceList. |
| 168 // |
| 169 // |callback| must not be null. |
| 170 virtual void GetAllResourceList( |
| 171 const GetResourceListCallback& callback) = 0; |
| 172 |
| 173 // Fetches a resource list in the directory with |directory_resource_id|. |
| 174 // |callback| will be called upon completion. |
| 175 // If the list is too long, it may be paged. In such a case, a URL to fetch |
| 176 // remaining results will be included in the returned result. See also |
| 177 // ContinueGetResourceList. |
| 178 // |
| 179 // |directory_resource_id| must not be empty. |
| 180 // |callback| must not be null. |
| 181 virtual void GetResourceListInDirectory( |
| 182 const std::string& directory_resource_id, |
| 183 const GetResourceListCallback& callback) = 0; |
| 184 |
| 185 // Searches the resources for the |search_query| from all the user's |
| 186 // resources. |callback| will be called upon completion. |
| 187 // If the list is too long, it may be paged. In such a case, a URL to fetch |
| 188 // remaining results will be included in the returned result. See also |
| 189 // ContinueGetResourceList. |
| 190 // |
| 191 // |search_query| must not be empty. |
| 192 // |callback| must not be null. |
| 193 virtual void Search( |
| 194 const std::string& search_query, |
| 195 const GetResourceListCallback& callback) = 0; |
| 196 |
| 197 // Searches the resources for the |search_query| from the directory with |
| 198 // |directory_resource_id|. |callback| will be called upon completion. |
| 199 // If the list is too long, it may be paged. In such a case, a URL to fetch |
| 200 // remaining results will be included in the returned result. See also |
| 201 // ContinueGetResourceList. |
| 202 // |
| 203 // Neither |search_query| nor |directory_resource_id| must be empty. |
| 204 // |callback| must not be null. |
| 205 virtual void SearchInDirectory( |
| 206 const std::string& search_query, |
| 207 const std::string& directory_resource_id, |
| 208 const GetResourceListCallback& callback) = 0; |
| 209 |
| 210 // Fetches change list since |start_changestamp|. |callback| will be |
| 211 // called upon completion. |
| 212 // If the list is too long, it may be paged. In such a case, a URL to fetch |
| 213 // remaining results will be included in the returned result. See also |
| 214 // ContinueGetResourceList. |
| 215 // |
| 216 // |callback| must not be null. |
| 217 virtual void GetChangeList( |
| 218 int64 start_changestamp, |
| 219 const GetResourceListCallback& callback) = 0; |
| 220 |
| 221 // Operations returning GetResourceList may be paged. In such a case, |
| 222 // a URL to fetch remaining result is returned. The URL can be used for this |
| 223 // method. |callback| will be called upon completion. |
| 224 // |
| 225 // |override_url| must not be empty. |
| 226 // |callback| must not be null. |
| 227 virtual void ContinueGetResourceList( |
| 228 const GURL& override_url, |
| 229 const GetResourceListCallback& callback) = 0; |
| 230 |
| 159 // Fetches single entry metadata from server. The entry's resource id equals | 231 // Fetches single entry metadata from server. The entry's resource id equals |
| 160 // |resource_id|. | 232 // |resource_id|. |
| 161 // Upon completion, invokes |callback| with results on the calling thread. | 233 // Upon completion, invokes |callback| with results on the calling thread. |
| 162 // |callback| must not be null. | 234 // |callback| must not be null. |
| 163 virtual void GetResourceEntry(const std::string& resource_id, | 235 virtual void GetResourceEntry(const std::string& resource_id, |
| 164 const GetResourceEntryCallback& callback) = 0; | 236 const GetResourceEntryCallback& callback) = 0; |
| 165 | 237 |
| 166 // Gets the account metadata from the server using the default account | 238 // Gets the account metadata from the server using the default account |
| 167 // metadata URL. Upon completion, invokes |callback| with results on the | 239 // metadata URL. Upon completion, invokes |callback| with results on the |
| 168 // calling thread. | 240 // calling thread. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // Upon completion, invokes |callback| with the link to open the file with | 377 // Upon completion, invokes |callback| with the link to open the file with |
| 306 // the provided app. |callback| must not be null. | 378 // the provided app. |callback| must not be null. |
| 307 virtual void AuthorizeApp(const std::string& resource_id, | 379 virtual void AuthorizeApp(const std::string& resource_id, |
| 308 const std::string& app_id, | 380 const std::string& app_id, |
| 309 const AuthorizeAppCallback& callback) = 0; | 381 const AuthorizeAppCallback& callback) = 0; |
| 310 }; | 382 }; |
| 311 | 383 |
| 312 } // namespace google_apis | 384 } // namespace google_apis |
| 313 | 385 |
| 314 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 386 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
| OLD | NEW |