Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_drive.h

Issue 371883003: Files.app: Add an private API to get a download URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698