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 provides Drive specific API functions. | 5 // This file provides Drive specific API functions. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ |
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ | 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestAccessToken", | 168 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestAccessToken", |
169 FILEMANAGERPRIVATE_REQUESTACCESSTOKEN) | 169 FILEMANAGERPRIVATE_REQUESTACCESSTOKEN) |
170 | 170 |
171 protected: | 171 protected: |
172 ~FileManagerPrivateRequestAccessTokenFunction() override {} | 172 ~FileManagerPrivateRequestAccessTokenFunction() override {} |
173 | 173 |
174 // AsyncExtensionFunction overrides. | 174 // AsyncExtensionFunction overrides. |
175 bool RunAsync() override; | 175 bool RunAsync() override; |
176 | 176 |
177 // Callback with a cached auth token (if available) or a fetched one. | 177 // Callback with a cached auth token (if available) or a fetched one. |
178 void OnAccessTokenFetched(google_apis::GDataErrorCode code, | 178 void OnAccessTokenFetched(google_apis::DriveApiErrorCode code, |
179 const std::string& access_token); | 179 const std::string& access_token); |
180 }; | 180 }; |
181 | 181 |
182 // Implements the chrome.fileManagerPrivate.getShareUrl method. | 182 // Implements the chrome.fileManagerPrivate.getShareUrl method. |
183 class FileManagerPrivateGetShareUrlFunction | 183 class FileManagerPrivateGetShareUrlFunction |
184 : public LoggedAsyncExtensionFunction { | 184 : public LoggedAsyncExtensionFunction { |
185 public: | 185 public: |
186 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getShareUrl", | 186 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getShareUrl", |
187 FILEMANAGERPRIVATE_GETSHAREURL) | 187 FILEMANAGERPRIVATE_GETSHAREURL) |
188 | 188 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 ~FileManagerPrivateGetDownloadUrlFunction() override; | 226 ~FileManagerPrivateGetDownloadUrlFunction() override; |
227 | 227 |
228 // AsyncExtensionFunction overrides. | 228 // AsyncExtensionFunction overrides. |
229 bool RunAsync() override; | 229 bool RunAsync() override; |
230 | 230 |
231 void OnGetResourceEntry(drive::FileError error, | 231 void OnGetResourceEntry(drive::FileError error, |
232 scoped_ptr<drive::ResourceEntry> entry); | 232 scoped_ptr<drive::ResourceEntry> entry); |
233 | 233 |
234 // Callback with an |access_token|, called by | 234 // Callback with an |access_token|, called by |
235 // drive::DriveReadonlyTokenFetcher. | 235 // drive::DriveReadonlyTokenFetcher. |
236 void OnTokenFetched(google_apis::GDataErrorCode code, | 236 void OnTokenFetched(google_apis::DriveApiErrorCode code, |
237 const std::string& access_token); | 237 const std::string& access_token); |
238 | 238 |
239 private: | 239 private: |
240 std::string download_url_; | 240 std::string download_url_; |
241 scoped_ptr<google_apis::AuthService> auth_service_; | 241 scoped_ptr<google_apis::AuthService> auth_service_; |
242 }; | 242 }; |
243 | 243 |
244 } // namespace extensions | 244 } // namespace extensions |
245 | 245 |
246 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ | 246 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ |
OLD | NEW |