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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h

Issue 2580713004: mediaview: Implement ArcDocumentsProviderBackendDelegate. (Closed)
Patch Set: Remove cache layer. Created 4 years 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
Index: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h
index 086e510b34013a0b35b3b582d1be83209154a8c6..8688e7279813ee04d12e7c6f6b0b71cd179cbb1b 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root.h
@@ -17,6 +17,8 @@
#include "components/arc/common/file_system.mojom.h"
#include "storage/browser/fileapi/async_file_util.h"
+class GURL;
+
namespace arc {
// Represents a file system root in Android Documents Provider.
@@ -28,6 +30,8 @@ class ArcDocumentsProviderRoot {
public:
using GetFileInfoCallback = storage::AsyncFileUtil::GetFileInfoCallback;
using ReadDirectoryCallback = storage::AsyncFileUtil::ReadDirectoryCallback;
+ using ResolveToContentUrlCallback =
+ base::Callback<void(const GURL& content_url)>;
ArcDocumentsProviderRoot(const std::string& authority,
const std::string& root_document_id);
@@ -42,6 +46,13 @@ class ArcDocumentsProviderRoot {
void ReadDirectory(const base::FilePath& path,
const ReadDirectoryCallback& callback);
+ // Resolves a file path into a content:// URL pointing to the file
+ // on DocumentsProvider. Returns URL that can be passed to
+ // ArcContentFileSystemFileSystemReader to read the content.
+ // On errors, an invalid GURL is returned.
+ void ResolveToContentUrl(const base::FilePath& path,
+ const ResolveToContentUrlCallback& callback);
+
private:
// Thin representation of a document in documents provider.
struct ThinDocument {
@@ -67,6 +78,10 @@ class ArcDocumentsProviderRoot {
void ReadDirectoryWithNameMapping(const ReadDirectoryCallback& callback,
NameMapping mapping);
+ void ResolveToContentUrlWithDocumentId(
+ const ResolveToContentUrlCallback& callback,
+ const std::string& document_id);
+
// Resolves |path| to a document ID. Failures are indicated by an empty
// document ID.
void ResolveToDocumentId(const base::FilePath& path,

Powered by Google App Engine
This is Rietveld 408576698