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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/extensions_api_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/file_handlers/non_native_file_system_delegate.h
diff --git a/extensions/browser/api/file_handlers/non_native_file_system_delegate.h b/extensions/browser/api/file_handlers/non_native_file_system_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d416dfc497aeed7733fd3eac13511760f29f7a7
--- /dev/null
+++ b/extensions/browser/api/file_handlers/non_native_file_system_delegate.h
@@ -0,0 +1,53 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_H_
+#define EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_H_
+
+#include "base/callback.h"
+#include "base/files/file_path.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace extensions {
+
+// Delegate for extension APIs to delegate tasks to a non-native file system on
+// Chrome OS.
+class NonNativeFileSystemDelegate {
+ public:
+ virtual ~NonNativeFileSystemDelegate() {}
+
+ // Checks whether |path| points to a non-local filesystem that
+ // requires special handling.
+ virtual bool IsUnderNonNativeLocalPath(content::BrowserContext* context,
+ const base::FilePath& path) = 0;
+
+ // Returns the mime type of the file pointed by |path|, and asynchronously
+ // sends the result to |callback|.
+ virtual void GetNonNativeLocalPathMimeType(
+ content::BrowserContext* context,
+ const base::FilePath& path,
+ const base::Callback<void(bool, const std::string&)>& callback) = 0;
+
+ // Checks whether |path| points to a non-local filesystem directory and calls
+ // |callback| with the result asynchronously.
+ virtual void IsNonNativeLocalPathDirectory(
+ content::BrowserContext* context,
+ const base::FilePath& path,
+ const base::Callback<void(bool)>& callback) = 0;
+
+ // Ensures a non-local file exists at |path|, i.e., it does nothing if a file
+ // is already present, or creates a file there if it isn't. Asynchronously
+ // calls |callback| with a success value.
+ virtual void PrepareNonNativeLocalFileForWritableApp(
+ content::BrowserContext* context,
+ const base::FilePath& path,
+ const base::Callback<void(bool)>& callback) = 0;
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_API_FILE_HANDLERS_NON_NATIVE_FILE_SYSTEM_DELEGATE_H_
« 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