| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H_ |
| 7 | 7 |
| 8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
| 9 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
| 10 #include "webkit/fileapi/syncable/sync_status_code.h" | 10 #include "webkit/fileapi/syncable/sync_status_code.h" |
| 11 #include "webkit/quota/quota_types.h" |
| 11 | 12 |
| 12 namespace fileapi { | 13 namespace fileapi { |
| 13 class FileSystemContext; | 14 class FileSystemContext; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace extensions { | 17 namespace extensions { |
| 17 | 18 |
| 18 class SyncFileSystemRequestFileSystemFunction | 19 class SyncFileSystemRequestFileSystemFunction |
| 19 : public AsyncExtensionFunction { | 20 : public AsyncExtensionFunction { |
| 20 public: | 21 public: |
| 21 DECLARE_EXTENSION_FUNCTION_NAME("syncFileSystem.requestFileSystem"); | 22 DECLARE_EXTENSION_FUNCTION_NAME("syncFileSystem.requestFileSystem"); |
| 22 | 23 |
| 23 protected: | 24 protected: |
| 24 virtual ~SyncFileSystemRequestFileSystemFunction() {} | 25 virtual ~SyncFileSystemRequestFileSystemFunction() {} |
| 25 virtual bool RunImpl() OVERRIDE; | 26 virtual bool RunImpl() OVERRIDE; |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 typedef SyncFileSystemRequestFileSystemFunction self; | 29 typedef SyncFileSystemRequestFileSystemFunction self; |
| 29 | 30 |
| 30 // Returns the file system context for this extension. | 31 // Returns the file system context for this extension. |
| 31 fileapi::FileSystemContext* GetFileSystemContext(); | 32 fileapi::FileSystemContext* GetFileSystemContext(); |
| 32 | 33 |
| 33 void DidInitializeFileSystemContext(const std::string& service_name, | 34 void DidInitializeFileSystemContext(const std::string& service_name, |
| 34 fileapi::SyncStatusCode status); | 35 fileapi::SyncStatusCode status); |
| 35 void DidOpenFileSystem(base::PlatformFileError error, | 36 void DidOpenFileSystem(base::PlatformFileError error, |
| 36 const std::string& file_system_name, | 37 const std::string& file_system_name, |
| 37 const GURL& root_url); | 38 const GURL& root_url); |
| 38 }; | 39 }; |
| 39 | 40 |
| 41 class SyncFileSystemGetUsageAndQuotaFunction |
| 42 : public AsyncExtensionFunction { |
| 43 public: |
| 44 DECLARE_EXTENSION_FUNCTION_NAME("syncFileSystem.getUsageAndQuota"); |
| 45 |
| 46 protected: |
| 47 virtual ~SyncFileSystemGetUsageAndQuotaFunction() {} |
| 48 virtual bool RunImpl() OVERRIDE; |
| 49 |
| 50 private: |
| 51 void DidGetUsageAndQuota(quota::QuotaStatusCode status, |
| 52 int64 usage, |
| 53 int64 quota); |
| 54 }; |
| 55 |
| 40 } // namespace extensions | 56 } // namespace extensions |
| 41 | 57 |
| 42 #endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H
_ | 58 #endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_API_H
_ |
| OLD | NEW |