| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" |
| 10 |
| 11 namespace content { |
| 12 class BrowserContext; |
| 13 } |
| 14 |
| 15 namespace extensions { |
| 16 |
| 17 // Delegate for extension APIs to delegate tasks to a non-native file system on |
| 18 // Chrome OS. |
| 19 class NonNativeFileSystemDelegate { |
| 20 public: |
| 21 virtual ~NonNativeFileSystemDelegate() {} |
| 22 |
| 23 // Checks whether |path| points to a non-local filesystem that |
| 24 // requires special handling. |
| 25 virtual bool IsUnderNonNativeLocalPath(content::BrowserContext* context, |
| 26 const base::FilePath& path) = 0; |
| 27 |
| 28 // Returns the mime type of the file pointed by |path|, and asynchronously |
| 29 // sends the result to |callback|. |
| 30 virtual void GetNonNativeLocalPathMimeType( |
| 31 content::BrowserContext* context, |
| 32 const base::FilePath& path, |
| 33 const base::Callback<void(bool, const std::string&)>& callback) = 0; |
| 34 |
| 35 // Checks whether |path| points to a non-local filesystem directory and calls |
| 36 // |callback| with the result asynchronously. |
| 37 virtual void IsNonNativeLocalPathDirectory( |
| 38 content::BrowserContext* context, |
| 39 const base::FilePath& path, |
| 40 const base::Callback<void(bool)>& callback) = 0; |
| 41 |
| 42 // Ensures a non-local file exists at |path|, i.e., it does nothing if a file |
| 43 // is already present, or creates a file there if it isn't. Asynchronously |
| 44 // calls |callback| with a success value. |
| 45 virtual void PrepareNonNativeLocalFileForWritableApp( |
| 46 content::BrowserContext* context, |
| 47 const base::FilePath& path, |
| 48 const base::Callback<void(bool)>& callback) = 0; |
| 49 }; |
| 50 |
| 51 } // namespace extensions |
| 52 |
| 53 #endif // EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_
H_ |
| OLD | NEW |