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

Side by Side Diff: extensions/browser/api/file_handlers/non_native_file_system_delegate.h

Issue 2666763005: API delegate for non-native file systems (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « extensions/browser/api/extensions_api_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « extensions/browser/api/extensions_api_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698