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

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

Issue 2580713004: mediaview: Implement ArcDocumentsProviderBackendDelegate. (Closed)
Patch Set: Remove WeakPtrFactory & add TODO for unit tests. Created 3 years, 11 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
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 de30a7477b8665dd5d702df176c4a7637bb812dd..fd8f8807e3b3ac777b6b68b4a91e35f4d1777311 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 {
@@ -71,6 +82,10 @@ class ArcDocumentsProviderRoot {
base::File::Error error,
NameToThinDocumentMap 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