OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file contains callback types used for communicating with the Drive | 5 // This file contains callback types used for communicating with the Drive |
6 // server via WAPI (Documents List API) and Drive API. | 6 // server via WAPI (Documents List API) and Drive API. |
7 | 7 |
8 #ifndef GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ | 8 #ifndef GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ |
9 #define GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ | 9 #define GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ |
10 | 10 |
11 #include "google_apis/drive/base_requests.h" | 11 #include "google_apis/drive/base_requests.h" |
12 | 12 |
13 namespace google_apis { | 13 namespace google_apis { |
14 | 14 |
15 class AboutResource; | 15 class AboutResource; |
16 class AppList; | 16 class AppList; |
17 | 17 |
18 // Callback used for getting AboutResource. | 18 // Callback used for getting AboutResource. |
19 typedef base::Callback<void(GDataErrorCode error, | 19 typedef base::Callback<void(DriveApiErrorCode error, |
20 scoped_ptr<AboutResource> about_resource)> | 20 scoped_ptr<AboutResource> about_resource)> |
21 AboutResourceCallback; | 21 AboutResourceCallback; |
22 | 22 |
23 // Callback used for getting ShareUrl. | 23 // Callback used for getting ShareUrl. |
24 typedef base::Callback<void(GDataErrorCode error, | 24 typedef base::Callback<void(DriveApiErrorCode error, |
25 const GURL& share_url)> GetShareUrlCallback; | 25 const GURL& share_url)> GetShareUrlCallback; |
26 | 26 |
27 // Callback used for getting AppList. | 27 // Callback used for getting AppList. |
28 typedef base::Callback<void(GDataErrorCode error, | 28 typedef base::Callback<void(DriveApiErrorCode error, |
29 scoped_ptr<AppList> app_list)> AppListCallback; | 29 scoped_ptr<AppList> app_list)> AppListCallback; |
30 | 30 |
31 // Callback used for authorizing an app. |open_url| is used to open the target | 31 // Callback used for authorizing an app. |open_url| is used to open the target |
32 // file with the authorized app. | 32 // file with the authorized app. |
33 typedef base::Callback<void(GDataErrorCode error, | 33 typedef base::Callback<void(DriveApiErrorCode error, |
34 const GURL& open_url)> | 34 const GURL& open_url)> |
35 AuthorizeAppCallback; | 35 AuthorizeAppCallback; |
36 | 36 |
37 // Closure for canceling a certain request. Each request-issuing method returns | 37 // Closure for canceling a certain request. Each request-issuing method returns |
38 // this type of closure. If it is called during the request is in-flight, the | 38 // this type of closure. If it is called during the request is in-flight, the |
39 // callback passed with the request is invoked with GDATA_CANCELLED. If the | 39 // callback passed with the request is invoked with DRIVE_CANCELLED. If the |
40 // request is already finished, nothing happens. | 40 // request is already finished, nothing happens. |
41 typedef base::Closure CancelCallback; | 41 typedef base::Closure CancelCallback; |
42 | 42 |
43 } // namespace google_apis | 43 } // namespace google_apis |
44 | 44 |
45 #endif // GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ | 45 #endif // GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_ |
OLD | NEW |