Chromium Code Reviews| 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_DRIVE_DRIVE_SERVICE_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ | 6 #define CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/google_apis/base_requests.h" | 10 #include "chrome/browser/google_apis/base_requests.h" |
| 11 #include "chrome/browser/google_apis/drive_common_callbacks.h" | |
| 11 | 12 |
| 12 class Profile; | 13 class Profile; |
| 13 | 14 |
| 14 namespace google_apis { | 15 namespace google_apis { |
|
tfarina
2013/06/19 01:27:53
do you plan to update this namespace to just drive
satorux1
2013/06/19 01:30:10
yes.
| |
| 15 | 16 |
| 16 class AboutResource; | |
| 17 class AppList; | |
| 18 class ResourceEntry; | |
| 19 class ResourceList; | |
| 20 | |
| 21 // Observer interface for DriveServiceInterface. | 17 // Observer interface for DriveServiceInterface. |
| 22 class DriveServiceObserver { | 18 class DriveServiceObserver { |
|
tfarina
2013/06/19 01:27:53
this could get this own header file, but I guess i
satorux1
2013/06/19 01:30:10
yes. we removed nested classes from drive related
| |
| 23 public: | 19 public: |
| 24 // Triggered when the service gets ready to send requests. | 20 // Triggered when the service gets ready to send requests. |
| 25 virtual void OnReadyToSendRequests() {} | 21 virtual void OnReadyToSendRequests() {} |
| 26 | 22 |
| 27 // Called when the refresh token was found to be invalid. | 23 // Called when the refresh token was found to be invalid. |
| 28 virtual void OnRefreshTokenInvalid() {} | 24 virtual void OnRefreshTokenInvalid() {} |
| 29 | 25 |
| 30 protected: | 26 protected: |
| 31 virtual ~DriveServiceObserver() {} | 27 virtual ~DriveServiceObserver() {} |
| 32 }; | 28 }; |
| 33 | 29 |
| 34 // Callback used for GetResourceList(). | |
| 35 typedef base::Callback<void(GDataErrorCode error, | |
| 36 scoped_ptr<ResourceList> resource_list)> | |
| 37 GetResourceListCallback; | |
| 38 | |
| 39 // Callback used for GetResourceEntry(). | |
| 40 typedef base::Callback<void(GDataErrorCode error, | |
| 41 scoped_ptr<ResourceEntry> entry)> | |
| 42 GetResourceEntryCallback; | |
| 43 | |
| 44 // Callback used for GetAboutResource(). | |
| 45 typedef base::Callback<void(GDataErrorCode error, | |
| 46 scoped_ptr<AboutResource> about_resource)> | |
| 47 GetAboutResourceCallback; | |
| 48 | |
| 49 // Callback used for GetApplicationInfo(). | |
| 50 typedef base::Callback<void(GDataErrorCode error, | |
| 51 scoped_ptr<AppList> app_list)> | |
| 52 GetAppListCallback; | |
| 53 | |
| 54 // Callback used for ResumeUpload() and GetUploadStatus(). | |
| 55 typedef base::Callback<void( | |
| 56 const UploadRangeResponse& response, | |
| 57 scoped_ptr<ResourceEntry> new_entry)> UploadRangeCallback; | |
| 58 | |
| 59 // Callback used for AuthorizeApp(). |open_url| is used to open the target | |
| 60 // file with the authorized app. | |
| 61 typedef base::Callback<void(GDataErrorCode error, | |
| 62 const GURL& open_url)> | |
| 63 AuthorizeAppCallback; | |
| 64 | |
| 65 // Closure for canceling a certain request. Each request-issuing method returns | |
| 66 // this type of closure. If it is called during the request is in-flight, the | |
| 67 // callback passed with the request is invoked with GDATA_CANCELLED. If the | |
| 68 // request is already finished, nothing happens. | |
| 69 typedef base::Closure CancelCallback; | |
| 70 | |
| 71 // This defines an interface for sharing by DriveService and MockDriveService | 30 // This defines an interface for sharing by DriveService and MockDriveService |
| 72 // so that we can do testing of clients of DriveService. | 31 // so that we can do testing of clients of DriveService. |
| 73 // | 32 // |
| 74 // All functions must be called on UI thread. DriveService is built on top of | 33 // All functions must be called on UI thread. DriveService is built on top of |
| 75 // URLFetcher that runs on UI thread. | 34 // URLFetcher that runs on UI thread. |
| 76 class DriveServiceInterface { | 35 class DriveServiceInterface { |
| 77 public: | 36 public: |
| 78 virtual ~DriveServiceInterface() {} | 37 virtual ~DriveServiceInterface() {} |
| 79 | 38 |
| 80 // Common service: | 39 // Common service: |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 // the provided app. |callback| must not be null. | 325 // the provided app. |callback| must not be null. |
| 367 virtual CancelCallback AuthorizeApp( | 326 virtual CancelCallback AuthorizeApp( |
| 368 const std::string& resource_id, | 327 const std::string& resource_id, |
| 369 const std::string& app_id, | 328 const std::string& app_id, |
| 370 const AuthorizeAppCallback& callback) = 0; | 329 const AuthorizeAppCallback& callback) = 0; |
| 371 }; | 330 }; |
| 372 | 331 |
| 373 } // namespace google_apis | 332 } // namespace google_apis |
| 374 | 333 |
| 375 #endif // CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ | 334 #endif // CHROME_BROWSER_DRIVE_DRIVE_SERVICE_INTERFACE_H_ |
| OLD | NEW |