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

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: 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..61394403dc0855a6d2dbcf7d8a3b1ff2dbed24a0 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h
@@ -240,6 +240,32 @@ class FileBrowserPrivateRequestDriveShareFunction
void OnAddPermission(drive::FileError error);
};
+// Implements the chrome.fileBrowserPrivate.getShareUrl method.
hashimoto 2014/07/09 07:48:57 s/getShareUrl/getDownloadUrl/
yoshiki 2014/07/11 13:48:50 Done.
+class FileBrowserPrivateGetDownloadUrlFunction
+ : public LoggedAsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getDownloadUrl",
+ FILEBROWSERPRIVATE_GETSHAREURL)
+
+ protected:
+ virtual ~FileBrowserPrivateGetDownloadUrlFunction() {}
+
+ // AsyncExtensionFunction overrides.
+ virtual bool RunAsync() OVERRIDE;
+
+ // Callback with an |download_url|, called by FileSystem::GetDownloadUrl.
+ void OnGetDownloadUrl(drive::FileError error, const GURL& download_url);
+
+ // 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_;
+ base::FilePath file_path_;
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_

Powered by Google App Engine
This is Rietveld 408576698