file_manager.mojom 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2020 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. [Stable, Extensible]
  7. enum OpenResult {
  8. kUnknown = 0,
  9. kSucceeded = 1,
  10. // Specified path does not exist.
  11. kFailedPathNotFound = 2,
  12. // Type of object found at path does not match what was expected. For example,
  13. // OpenFile was called on a folder.
  14. kFailedInvalidType = 3,
  15. // No file handler found for the file. For example, user tried to open a macOS
  16. // .dmg file.
  17. kFailedNoHandlerForFileType = 4,
  18. // Open failed due to some other error.
  19. kFailedFileError = 5,
  20. };
  21. // Interacts with the file manager (the Chrome OS equivalent of macOS Finder or
  22. // Windows Explorer). Implemented in ash-chrome.
  23. [Stable, Uuid="61e61690-fb13-40c8-a167-d7fc18a8fe6b"]
  24. interface FileManager {
  25. // Deprecated. Prefer ShowItemInFolder() below.
  26. DeprecatedShowItemInFolder@0(mojo_base.mojom.FilePath path);
  27. // Opens the folder containing the item specified by |path| and selects the
  28. // item. If the path is invalid or the file doesn't exist, an error dialog is
  29. // shown. Added in M88.
  30. [MinVersion=1]
  31. ShowItemInFolder@1(mojo_base.mojom.FilePath path) => (OpenResult result);
  32. // As above, but opens the folder at |path| and does not select an item.
  33. // Added in M88.
  34. [MinVersion=1]
  35. OpenFolder@2(mojo_base.mojom.FilePath path) => (OpenResult result);
  36. // Opens the file specified by |path| in the desktop's default manner. For
  37. // example, an image file might be opened by the image gallery app. Added in
  38. // M88.
  39. [MinVersion=1]
  40. OpenFile@3(mojo_base.mojom.FilePath path) => (OpenResult result);
  41. };