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

Side by Side Diff: chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h

Issue 11146034: Add GetUsageAndQuota() to Syncable API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mihai Review #2 Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 _
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698