Index: chrome/browser/chromeos/extensions/file_manager/private_api_drive.h |
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h |
index b3eec926c2a7c2011d899ef9258ba03524c55a57..3e58e513c65a3cf715d30c189052cb9e30c595b1 100644 |
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h |
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h |
@@ -18,6 +18,10 @@ class ResourceEntry; |
struct SearchResultInfo; |
} |
+namespace google_apis { |
+class AuthService; |
+} |
+ |
namespace extensions { |
namespace api { |
@@ -240,6 +244,34 @@ class FileBrowserPrivateRequestDriveShareFunction |
void OnAddPermission(drive::FileError error); |
}; |
+// Implements the chrome.fileBrowserPrivate.getShareUrl method. |
+class FileBrowserPrivateGetDownloadUrlFunction |
+ : public LoggedAsyncExtensionFunction { |
+ public: |
+ FileBrowserPrivateGetDownloadUrlFunction(); |
+ |
+ DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getDownloadUrl", |
+ FILEBROWSERPRIVATE_GETSHAREURL) |
+ |
+ protected: |
+ virtual ~FileBrowserPrivateGetDownloadUrlFunction(); |
+ |
+ // AsyncExtensionFunction overrides. |
+ virtual bool RunAsync() OVERRIDE; |
+ |
+ void OnGetResourceEntry(drive::FileError error, |
+ scoped_ptr<drive::ResourceEntry> entry); |
+ |
+ // Callback with an |access_token|, called by |
+ // drive::DriveReadonlyTokenFetcher. |
+ void OnTokenFetched(google_apis::GDataErrorCode code, |
+ const std::string& access_token); |
+ |
+ private: |
+ std::string download_url_; |
+ scoped_ptr<google_apis::AuthService> auth_service_; |
+}; |
+ |
} // namespace extensions |
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ |