volume_manager.mojom 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module crosapi.mojom;
  5. import "mojo/public/mojom/base/file_path.mojom";
  6. // Volume info for chrome.fileSystem API usage, serving as intermediary from
  7. // file_manager::Volume to file_system::Volume, with additional fields.
  8. [Stable]
  9. struct Volume {
  10. string volume_id@0;
  11. string volume_label@1;
  12. // Equivalent to !is_read_only.
  13. bool writable@2;
  14. mojo_base.mojom.FilePath mount_path@3;
  15. // Whether the volume can be used by lacros-chrome. This is needed because
  16. // virtual file system support in lacros-chrome is WIP.
  17. // TODO(crbug.com/1296438): Deprecate once VFS works fully.
  18. bool is_available_to_lacros@4;
  19. };
  20. // Interface for volume list observers. Implemented by lacros-chrome. Used by
  21. // ash-chrome to send Volume list info and updates.
  22. [Stable, Uuid="ed85b34f-5ccc-41cd-b688-c0601dd629c3"]
  23. interface VolumeListObserver {
  24. // Called when the volume list changes.
  25. OnVolumeListChanged@0(array<Volume> volume_list);
  26. };
  27. // Interface with Ash volume manager. Implemented in ash-chrome.
  28. [Stable, Uuid="a5f21bb6-e2f9-4ddf-a01a-f73c09915936"]
  29. interface VolumeManager {
  30. // Adds an observer for volume list changes.
  31. AddVolumeListObserver@0(pending_remote<VolumeListObserver> observer);
  32. // Returns an unfiltered list of volumes.
  33. GetFullVolumeList@1() => (array<Volume> result);
  34. // Returns data needed to mount a volume identified by |volume_id|, or empty
  35. // on error.
  36. GetVolumeMountInfo@2(string volume_id) => (Volume? result);
  37. };