forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mediaview: Mount ARC documents provider file system volumes.
New media view volumes are added to chromeos::VolumeManager so that they are available to Files.app. UI patches are coming later, so at this point it looks like unusable unknown volumes appear in Files.app. To hide them from users for now, the feature is guarded with base::FeatureList. Once UI is ready I will make them enabled by default. BUG=chromium:671511 TEST=New (unusable) volumes are shown with --enable-features=ArcMediaView TEST=Media views work with local pending UI patches Review-Url: https://codereview.chromium.org/2580303002 Cr-Commit-Position: refs/heads/master@{#443205}
- Loading branch information
Showing
16 changed files
with
978 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
chrome/browser/chromeos/arc/fileapi/arc_media_view_util.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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. | ||
|
||
#include "chrome/browser/chromeos/arc/fileapi/arc_media_view_util.h" | ||
|
||
namespace arc { | ||
|
||
namespace { | ||
|
||
constexpr char kMediaViewVolumeIdPrefix[] = "media_view:"; | ||
|
||
} // namespace | ||
|
||
const base::Feature kMediaViewFeature{"ArcMediaView", | ||
base::FEATURE_DISABLED_BY_DEFAULT}; | ||
|
||
const char kMediaDocumentsProviderAuthority[] = | ||
"com.android.providers.media.documents"; | ||
|
||
const char kImagesRootDocumentId[] = "images_root"; | ||
const char kVideosRootDocumentId[] = "videos_root"; | ||
const char kAudioRootDocumentId[] = "audio_root"; | ||
|
||
std::string GetMediaViewVolumeId(const std::string& root_document_id) { | ||
return std::string(kMediaViewVolumeIdPrefix) + root_document_id; | ||
} | ||
|
||
} // namespace arc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// 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. | ||
// | ||
// Utilities for ARC Media View. | ||
|
||
#ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_MEDIA_VIEW_UTIL_H_ | ||
#define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_MEDIA_VIEW_UTIL_H_ | ||
|
||
#include <string> | ||
|
||
#include "base/feature_list.h" | ||
|
||
namespace arc { | ||
|
||
// base::FeatureList feature for ARC media view. | ||
extern const base::Feature kMediaViewFeature; | ||
|
||
// Authority of MediaDocumentsProvider in Android. | ||
extern const char kMediaDocumentsProviderAuthority[]; | ||
|
||
// Document IDs of file system roots in MediaDocumentsProvider. | ||
extern const char kImagesRootDocumentId[]; | ||
extern const char kVideosRootDocumentId[]; | ||
extern const char kAudioRootDocumentId[]; | ||
|
||
// Returns an ID of a Media View volume. | ||
std::string GetMediaViewVolumeId(const std::string& root_document_id); | ||
|
||
} // namespace arc | ||
|
||
#endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_MEDIA_VIEW_UTIL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.