electron/shell/common/api/api.mojom
2020-03-11 18:07:54 -07:00

97 lines
2.8 KiB
Text

module electron.mojom;
import "mojo/public/mojom/base/string16.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "third_party/blink/public/mojom/messaging/cloneable_message.mojom";
import "third_party/blink/public/mojom/messaging/transferable_message.mojom";
interface ElectronRenderer {
Message(
bool internal,
bool send_to_all,
string channel,
blink.mojom.CloneableMessage arguments,
int32 sender_id);
ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
UpdateCrashpadPipeName(string pipe_name);
// This is an API specific to the "remote" module, and will ultimately be
// replaced by generic IPC once WeakRef is generally available.
[EnableIf=enable_remote_module]
DereferenceRemoteJSCallback(
string context_id,
int32 object_id);
TakeHeapSnapshot(handle file) => (bool success);
};
interface ElectronAutofillAgent {
AcceptDataListSuggestion(mojo_base.mojom.String16 value);
};
interface ElectronAutofillDriver {
ShowAutofillPopup(gfx.mojom.RectF bounds, array<mojo_base.mojom.String16> values, array<mojo_base.mojom.String16> labels);
HideAutofillPopup();
};
struct DraggableRegion {
bool draggable;
gfx.mojom.Rect bounds;
};
interface ElectronBrowser {
// Emits an event on |channel| from the ipcMain JavaScript object in the main
// process.
Message(
bool internal,
string channel,
blink.mojom.CloneableMessage arguments);
// Emits an event on |channel| from the ipcMain JavaScript object in the main
// process, and returns the response.
Invoke(
bool internal,
string channel,
blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
ReceivePostMessage(string channel, blink.mojom.TransferableMessage message);
// Emits an event on |channel| from the ipcMain JavaScript object in the main
// process, and waits synchronously for a response.
[Sync]
MessageSync(
bool internal,
string channel,
blink.mojom.CloneableMessage arguments) => (blink.mojom.CloneableMessage result);
// Emits an event from the |ipcRenderer| JavaScript object in the target
// WebContents's main frame, specified by |web_contents_id|.
MessageTo(
bool internal,
bool send_to_all,
int32 web_contents_id,
string channel,
blink.mojom.CloneableMessage arguments);
MessageHost(
string channel,
blink.mojom.CloneableMessage arguments);
// This is an API specific to the "remote" module, and will ultimately be
// replaced by generic IPC once WeakRef is generally available.
[EnableIf=enable_remote_module]
DereferenceRemoteJSObject(
string context_id,
int32 object_id,
int32 ref_count);
UpdateDraggableRegions(
array<DraggableRegion> regions);
SetTemporaryZoomLevel(double zoom_level);
[Sync]
DoGetZoomLevel() => (double result);
};