api.mojom 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. bool send_to_all,
  10. string channel,
  11. blink.mojom.CloneableMessage arguments,
  12. int32 sender_id);
  13. ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
  14. // This is an API specific to the "remote" module, and will ultimately be
  15. // replaced by generic IPC once WeakRef is generally available.
  16. [EnableIf=enable_remote_module]
  17. DereferenceRemoteJSCallback(
  18. string context_id,
  19. int32 object_id);
  20. NotifyUserActivation();
  21. TakeHeapSnapshot(handle file) => (bool success);
  22. };
  23. interface ElectronAutofillAgent {
  24. AcceptDataListSuggestion(mojo_base.mojom.String16 value);
  25. };
  26. interface ElectronAutofillDriver {
  27. ShowAutofillPopup(gfx.mojom.RectF bounds, array<mojo_base.mojom.String16> values, array<mojo_base.mojom.String16> labels);
  28. HideAutofillPopup();
  29. };
  30. struct DraggableRegion {
  31. bool draggable;
  32. gfx.mojom.Rect bounds;
  33. };
  34. interface ElectronBrowser {
  35. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  36. // process.
  37. Message(
  38. bool internal,
  39. string channel,
  40. blink.mojom.CloneableMessage arguments);
  41. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  42. // process, and returns the response.
  43. Invoke(
  44. bool internal,
  45. string channel,
  46. blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
  47. // Informs underlying WebContents that first non-empty layout was performed
  48. // by compositor.
  49. OnFirstNonEmptyLayout();
  50. ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
  51. // Emits an event on |channel| from the ipcMain JavaScript object in the main
  52. // process, and waits synchronously for a response.
  53. [Sync]
  54. MessageSync(
  55. bool internal,
  56. string channel,
  57. blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
  58. // Emits an event from the |ipcRenderer| JavaScript object in the target
  59. // WebContents's main frame, specified by |web_contents_id|.
  60. MessageTo(
  61. bool internal,
  62. bool send_to_all,
  63. int32 web_contents_id,
  64. string channel,
  65. blink.mojom.CloneableMessage arguments);
  66. MessageHost(
  67. string channel,
  68. blink.mojom.CloneableMessage arguments);
  69. // This is an API specific to the "remote" module, and will ultimately be
  70. // replaced by generic IPC once WeakRef is generally available.
  71. [EnableIf=enable_remote_module]
  72. DereferenceRemoteJSObject(
  73. string context_id,
  74. int32 object_id,
  75. int32 ref_count);
  76. UpdateDraggableRegions(
  77. array<DraggableRegion> regions);
  78. SetTemporaryZoomLevel(double zoom_level);
  79. [Sync]
  80. DoGetZoomLevel() => (double result);
  81. };