electron/atom/common/api/api.mojom
Jeremy Apthorp d1371c5dd0 refactor: mojofy zoom api (#18608)
* refactor: mojofy zoom api

* remove unneeded #includes

* remove outdated comment
2019-06-04 10:18:22 +09:00

67 lines
1.8 KiB
Text

module atom.mojom;
import "mojo/public/mojom/base/values.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";
interface ElectronRenderer {
Message(
bool internal,
bool send_to_all,
string channel,
mojo_base.mojom.ListValue arguments,
int32 sender_id);
TakeHeapSnapshot(handle file) => (bool success);
};
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,
mojo_base.mojom.ListValue arguments);
// Emits an event on |channel| from the ipcMain JavaScript object in the main
// process, and returns the response.
Invoke(
string channel,
mojo_base.mojom.ListValue arguments) => (mojo_base.mojom.Value result);
// Emits an event on |channel| from the ipcMain JavaScript object in the main
// process, and waits synchronously for a response.
//
// NB. this is not marked [Sync] because mojo synchronous methods can be
// reordered with respect to asynchronous methods on the same channel.
// Instead, callers can manually block on the response to this method.
MessageSync(
bool internal,
string channel,
mojo_base.mojom.ListValue arguments) => (mojo_base.mojom.Value 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,
mojo_base.mojom.ListValue arguments);
MessageHost(
string channel,
mojo_base.mojom.ListValue arguments);
UpdateDraggableRegions(
array<DraggableRegion> regions);
SetTemporaryZoomLevel(double zoom_level);
[Sync]
DoGetZoomLevel() => (double result);
};