blob: 28702db66c2f06f65174d71fee2ae2362f9e78b4 [file] [log] [blame]
// 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 COMPONENTS_EXO_FILE_HELPER_H_
#define COMPONENTS_EXO_FILE_HELPER_H_
#include <string>
class GURL;
namespace base {
class FilePath;
}
namespace exo {
class FileHelper {
public:
virtual ~FileHelper() {}
// Returns mime type which is used for list of Uris returned by this
// FileHelper.
virtual std::string GetMimeTypeForUriList() const = 0;
// Converts native file path to URL which can be used by application with
// |app_id|. We don't expose enter file system to a container directly.
// Instead we mount specific directory in the containers' namespace. Thus we
// need to convert native path to file URL which points mount point in
// containers. The conversion should be container specific, now we only have
// ARC container though.
virtual bool GetUrlFromPath(const std::string& app_id,
const base::FilePath& path,
GURL* out) = 0;
// Converts filesystem:// URL to something that applications can understand.
// e.g. content:// URI for Android apps.
virtual bool GetUrlFromFileSystemUrl(const std::string& app_id,
const GURL& file_system_url,
GURL* out) = 0;
};
} // namespace exo
#endif // COMPONENTS_EXO_FILE_HELPER_H_