Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_system_provider / provided_file_system_interface.h
1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERFACE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERFACE_H_
7
8 #include "webkit/browser/fileapi/async_file_util.h"
9
10 class EventRouter;
11
12 namespace base {
13 class FilePath;
14 }  // namespace base
15
16 namespace chromeos {
17 namespace file_system_provider {
18
19 class ProvidedFileSystemInfo;
20 class RequestManager;
21
22 // Interface for a provided file system. Acts as a proxy between providers
23 // and clients.
24 // TODO(mtomasz): Add more methods once implemented.
25 class ProvidedFileSystemInterface {
26  public:
27   virtual ~ProvidedFileSystemInterface() {}
28
29   // Requests unmounting of the file system. The callback is called when the
30   // request is accepted or rejected, with an error code.
31   virtual void RequestUnmount(
32       const fileapi::AsyncFileUtil::StatusCallback& callback) = 0;
33
34   // Requests metadata of the passed |entry_path|. It can be either a file
35   // or a directory.
36   virtual void GetMetadata(
37       const base::FilePath& entry_path,
38       const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) = 0;
39   // Requests enumerating entries from the passed |directory_path|. The callback
40   // can be called multiple times until either an error is returned or the
41   // has_more field is set to false.
42   virtual void ReadDirectory(
43       const base::FilePath& directory_path,
44       const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) = 0;
45
46   // Returns a provided file system info for this file system.
47   virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const = 0;
48
49   // Returns a request manager for the file system.
50   virtual RequestManager* GetRequestManager() = 0;
51 };
52
53 }  // namespace file_system_provider
54 }  // namespace chromeos
55
56 #endif  // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERFACE_H_