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_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 } // namespace file_system_api | 34 } // namespace file_system_api |
35 | 35 |
36 class FileSystemGetDisplayPathFunction : public ChromeSyncExtensionFunction { | 36 class FileSystemGetDisplayPathFunction : public ChromeSyncExtensionFunction { |
37 public: | 37 public: |
38 DECLARE_EXTENSION_FUNCTION("fileSystem.getDisplayPath", | 38 DECLARE_EXTENSION_FUNCTION("fileSystem.getDisplayPath", |
39 FILESYSTEM_GETDISPLAYPATH) | 39 FILESYSTEM_GETDISPLAYPATH) |
40 | 40 |
41 protected: | 41 protected: |
42 virtual ~FileSystemGetDisplayPathFunction() {} | 42 virtual ~FileSystemGetDisplayPathFunction() {} |
43 virtual bool RunImpl() OVERRIDE; | 43 virtual bool RunSync() OVERRIDE; |
44 }; | 44 }; |
45 | 45 |
46 class FileSystemEntryFunction : public ChromeAsyncExtensionFunction { | 46 class FileSystemEntryFunction : public ChromeAsyncExtensionFunction { |
47 protected: | 47 protected: |
48 FileSystemEntryFunction(); | 48 FileSystemEntryFunction(); |
49 | 49 |
50 virtual ~FileSystemEntryFunction() {} | 50 virtual ~FileSystemEntryFunction() {} |
51 | 51 |
52 // This is called when writable file entries are being returned. The function | 52 // This is called when writable file entries are being returned. The function |
53 // will ensure the files exist, creating them if necessary, and also check | 53 // will ensure the files exist, creating them if necessary, and also check |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 base::FilePath path_; | 98 base::FilePath path_; |
99 }; | 99 }; |
100 | 100 |
101 class FileSystemIsWritableEntryFunction : public ChromeSyncExtensionFunction { | 101 class FileSystemIsWritableEntryFunction : public ChromeSyncExtensionFunction { |
102 public: | 102 public: |
103 DECLARE_EXTENSION_FUNCTION("fileSystem.isWritableEntry", | 103 DECLARE_EXTENSION_FUNCTION("fileSystem.isWritableEntry", |
104 FILESYSTEM_ISWRITABLEENTRY) | 104 FILESYSTEM_ISWRITABLEENTRY) |
105 | 105 |
106 protected: | 106 protected: |
107 virtual ~FileSystemIsWritableEntryFunction() {} | 107 virtual ~FileSystemIsWritableEntryFunction() {} |
108 virtual bool RunImpl() OVERRIDE; | 108 virtual bool RunSync() OVERRIDE; |
109 }; | 109 }; |
110 | 110 |
111 class FileSystemChooseEntryFunction : public FileSystemEntryFunction { | 111 class FileSystemChooseEntryFunction : public FileSystemEntryFunction { |
112 public: | 112 public: |
113 // Allow picker UI to be skipped in testing. | 113 // Allow picker UI to be skipped in testing. |
114 static void SkipPickerAndAlwaysSelectPathForTest(base::FilePath* path); | 114 static void SkipPickerAndAlwaysSelectPathForTest(base::FilePath* path); |
115 static void SkipPickerAndAlwaysSelectPathsForTest( | 115 static void SkipPickerAndAlwaysSelectPathsForTest( |
116 std::vector<base::FilePath>* paths); | 116 std::vector<base::FilePath>* paths); |
117 static void SkipPickerAndSelectSuggestedPathForTest(); | 117 static void SkipPickerAndSelectSuggestedPathForTest(); |
118 static void SkipPickerAndAlwaysCancelForTest(); | 118 static void SkipPickerAndAlwaysCancelForTest(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // The path to the file to retain. | 191 // The path to the file to retain. |
192 base::FilePath path_; | 192 base::FilePath path_; |
193 }; | 193 }; |
194 | 194 |
195 class FileSystemIsRestorableFunction : public ChromeSyncExtensionFunction { | 195 class FileSystemIsRestorableFunction : public ChromeSyncExtensionFunction { |
196 public: | 196 public: |
197 DECLARE_EXTENSION_FUNCTION("fileSystem.isRestorable", FILESYSTEM_ISRESTORABLE) | 197 DECLARE_EXTENSION_FUNCTION("fileSystem.isRestorable", FILESYSTEM_ISRESTORABLE) |
198 | 198 |
199 protected: | 199 protected: |
200 virtual ~FileSystemIsRestorableFunction() {} | 200 virtual ~FileSystemIsRestorableFunction() {} |
201 virtual bool RunImpl() OVERRIDE; | 201 virtual bool RunSync() OVERRIDE; |
202 }; | 202 }; |
203 | 203 |
204 class FileSystemRestoreEntryFunction : public FileSystemEntryFunction { | 204 class FileSystemRestoreEntryFunction : public FileSystemEntryFunction { |
205 public: | 205 public: |
206 DECLARE_EXTENSION_FUNCTION("fileSystem.restoreEntry", FILESYSTEM_RESTOREENTRY) | 206 DECLARE_EXTENSION_FUNCTION("fileSystem.restoreEntry", FILESYSTEM_RESTOREENTRY) |
207 | 207 |
208 protected: | 208 protected: |
209 virtual ~FileSystemRestoreEntryFunction() {} | 209 virtual ~FileSystemRestoreEntryFunction() {} |
210 virtual bool RunImpl() OVERRIDE; | 210 virtual bool RunImpl() OVERRIDE; |
211 }; | 211 }; |
212 | 212 |
213 } // namespace extensions | 213 } // namespace extensions |
214 | 214 |
215 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ | 215 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ |
OLD | NEW |