api.mojom 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. module electron.mojom;
  2. import "mojo/public/mojom/base/string16.mojom";
  3. import "ui/gfx/geometry/mojom/geometry.mojom";
  4. import "third_party/blink/public/mojom/messaging/cloneable_message.mojom";
  5. import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
  6. interface ElectronRenderer {
  7. Message(
  8. bool internal,
  9. string channel,
  10. blink.mojom.CloneableMessage arguments);
  11. ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
  12. TakeHeapSnapshot(handle file) => (bool success);
  13. };
  14. interface ElectronAutofillAgent {
  15. AcceptDataListSuggestion(mojo_base.mojom.String16 value);
  16. };
  17. interface ElectronAutofillDriver {
  18. ShowAutofillPopup(gfx.mojom.RectF bounds, array<mojo_base.mojom.String16> values, array<mojo_base.mojom.String16> labels);
  19. HideAutofillPopup();
  20. };
  21. struct DraggableRegion {
  22. bool draggable;
  23. gfx.mojom.Rect bounds;
  24. };
  25. interface ElectronWebContentsUtility {
  26. // Informs underlying WebContents that first non-empty layout was performed
  27. // by compositor.
  28. OnFirstNonEmptyLayout();
  29. UpdateDraggableRegions(
  30. array<DraggableRegion> regions);
  31. SetTemporaryZoomLevel(double zoom_level);
  32. [Sync]
  33. DoGetZoomLevel() => (double result);
  34. };
  35. interface ElectronApiIPC {
  36. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  37. // process.
  38. Message(
  39. bool internal,
  40. string channel,
  41. blink.mojom.CloneableMessage arguments);
  42. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  43. // process, and returns the response.
  44. Invoke(
  45. bool internal,
  46. string channel,
  47. blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
  48. ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
  49. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  50. // process, and waits synchronously for a response.
  51. [Sync]
  52. MessageSync(
  53. bool internal,
  54. string channel,
  55. blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
  56. MessageHost(
  57. string channel,
  58. blink.mojom.CloneableMessage arguments);
  59. };