| 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 "chrome/browser/chromeos/drive/file_errors.h" | 10 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 11 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 11 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
| 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" | 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" |
| 13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 14 | 14 |
| 15 namespace drive { | 15 namespace drive { |
| 16 class FileCacheEntry; | 16 class FileCacheEntry; |
| 17 class ResourceEntry; | 17 class ResourceEntry; |
| 18 struct SearchResultInfo; | 18 struct SearchResultInfo; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace google_apis { |
| 22 class AuthService; |
| 23 } |
| 24 |
| 21 namespace extensions { | 25 namespace extensions { |
| 22 | 26 |
| 23 namespace api { | 27 namespace api { |
| 24 namespace file_browser_private { | 28 namespace file_browser_private { |
| 25 struct DriveEntryProperties; | 29 struct DriveEntryProperties; |
| 26 } // namespace file_browser_private | 30 } // namespace file_browser_private |
| 27 } // namespace api | 31 } // namespace api |
| 28 | 32 |
| 29 // Retrieves property information for an entry and returns it as a dictionary. | 33 // Retrieves property information for an entry and returns it as a dictionary. |
| 30 // On error, returns a dictionary with the key "error" set to the error number | 34 // On error, returns a dictionary with the key "error" set to the error number |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 237 |
| 234 protected: | 238 protected: |
| 235 virtual ~FileBrowserPrivateRequestDriveShareFunction() {} | 239 virtual ~FileBrowserPrivateRequestDriveShareFunction() {} |
| 236 virtual bool RunAsync() OVERRIDE; | 240 virtual bool RunAsync() OVERRIDE; |
| 237 | 241 |
| 238 private: | 242 private: |
| 239 // Called back after the drive file system operation is finished. | 243 // Called back after the drive file system operation is finished. |
| 240 void OnAddPermission(drive::FileError error); | 244 void OnAddPermission(drive::FileError error); |
| 241 }; | 245 }; |
| 242 | 246 |
| 247 // Implements the chrome.fileBrowserPrivate.getShareUrl method. |
| 248 class FileBrowserPrivateGetDownloadUrlFunction |
| 249 : public LoggedAsyncExtensionFunction { |
| 250 public: |
| 251 FileBrowserPrivateGetDownloadUrlFunction(); |
| 252 |
| 253 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getDownloadUrl", |
| 254 FILEBROWSERPRIVATE_GETSHAREURL) |
| 255 |
| 256 protected: |
| 257 virtual ~FileBrowserPrivateGetDownloadUrlFunction(); |
| 258 |
| 259 // AsyncExtensionFunction overrides. |
| 260 virtual bool RunAsync() OVERRIDE; |
| 261 |
| 262 void OnGetResourceEntry(drive::FileError error, |
| 263 scoped_ptr<drive::ResourceEntry> entry); |
| 264 |
| 265 // Callback with an |access_token|, called by |
| 266 // drive::DriveReadonlyTokenFetcher. |
| 267 void OnTokenFetched(google_apis::GDataErrorCode code, |
| 268 const std::string& access_token); |
| 269 |
| 270 private: |
| 271 std::string download_url_; |
| 272 scoped_ptr<google_apis::AuthService> auth_service_; |
| 273 }; |
| 274 |
| 243 } // namespace extensions | 275 } // namespace extensions |
| 244 | 276 |
| 245 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ | 277 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_DRIVE_H_ |
| OLD | NEW |