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

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api.h

Issue 656733002: Fix filesystem.retainEntry API to handle non-native directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed windows build. Created 6 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
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_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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { 175 class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction {
176 public: 176 public:
177 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY) 177 DECLARE_EXTENSION_FUNCTION("fileSystem.retainEntry", FILESYSTEM_RETAINENTRY)
178 178
179 protected: 179 protected:
180 virtual ~FileSystemRetainEntryFunction() {} 180 virtual ~FileSystemRetainEntryFunction() {}
181 virtual bool RunAsync() override; 181 virtual bool RunAsync() override;
182 182
183 private: 183 private:
184 // Retains the file entry referenced by |entry_id| in apps::SavedFilesService. 184 // Retains the file entry referenced by |entry_id| in apps::SavedFilesService.
185 // |entry_id| must refer to an entry in an isolated file system. 185 // |entry_id| must refer to an entry in an isolated file system. |path| is a
186 void RetainFileEntry(const std::string& entry_id); 186 // path of the entry. |file_info| is base::File::Info of the entry if it can
187 187 // be obtained.
188 void SetIsDirectoryOnFileThread(); 188 void RetainFileEntry(const std::string& entry_id,
189 189 const base::FilePath& path,
190 // Whether the file being retained is a directory. 190 scoped_ptr<base::File::Info> file_info);
191 bool is_directory_;
192
193 // The path to the file to retain.
194 base::FilePath path_;
195 }; 191 };
196 192
197 class FileSystemIsRestorableFunction : public ChromeSyncExtensionFunction { 193 class FileSystemIsRestorableFunction : public ChromeSyncExtensionFunction {
198 public: 194 public:
199 DECLARE_EXTENSION_FUNCTION("fileSystem.isRestorable", FILESYSTEM_ISRESTORABLE) 195 DECLARE_EXTENSION_FUNCTION("fileSystem.isRestorable", FILESYSTEM_ISRESTORABLE)
200 196
201 protected: 197 protected:
202 virtual ~FileSystemIsRestorableFunction() {} 198 virtual ~FileSystemIsRestorableFunction() {}
203 virtual bool RunSync() override; 199 virtual bool RunSync() override;
204 }; 200 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 FILESYSTEM_GETOBSERVEDENTRIES); 235 FILESYSTEM_GETOBSERVEDENTRIES);
240 236
241 protected: 237 protected:
242 virtual ~FileSystemGetObservedEntriesFunction() {} 238 virtual ~FileSystemGetObservedEntriesFunction() {}
243 virtual bool RunSync() override; 239 virtual bool RunSync() override;
244 }; 240 };
245 241
246 } // namespace extensions 242 } // namespace extensions
247 243
248 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_ 244 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_FILE_SYSTEM_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698