Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_system_provider / mount_path_util.h
index 1a19752..37fd896 100644 (file)
@@ -24,7 +24,10 @@ base::FilePath GetMountPath(Profile* profile,
                             const std::string& extension_id,
                             const std::string& file_system_id);
 
-// Finds file system, which is responsible for handling the specified |url| by
+// Checks whether a local path is handled by File System Provider API or not.
+bool IsFileSystemProviderLocalPath(const base::FilePath& local_path);
+
+// Finds a file system, which is responsible for handling the specified |url| by
 // analysing the mount path. Also, extract the file path from the virtual path
 // to be used by the file system operations.
 class FileSystemURLParser {
@@ -47,6 +50,29 @@ class FileSystemURLParser {
   DISALLOW_COPY_AND_ASSIGN(FileSystemURLParser);
 };
 
+// Finds a file system, which is responsible for handling the specified
+// |local_path| by analysing the mount point name. Alsoo, extract the file path
+// from the local path to be used by the file system operations.
+class LocalPathParser {
+ public:
+  LocalPathParser(Profile* profile, const base::FilePath& local_path);
+  virtual ~LocalPathParser();
+
+  // Parses the |local_path| passed to the constructor. If parsing succeeds,
+  // then returns true. Otherwise, false. Must be called on UI thread.
+  bool Parse();
+
+  ProvidedFileSystemInterface* file_system() const { return file_system_; }
+  const base::FilePath& file_path() const { return file_path_; }
+
+ private:
+  Profile* profile_;
+  base::FilePath local_path_;
+  ProvidedFileSystemInterface* file_system_;
+  base::FilePath file_path_;
+
+  DISALLOW_COPY_AND_ASSIGN(LocalPathParser);
+};
 }  // namespace util
 }  // namespace file_system_provider
 }  // namespace chromeos