2021-05-14 18:58:55 +02:00
|
|
|
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
module cef.mojom;
|
|
|
|
|
|
|
|
import "mojo/public/mojom/base/shared_memory.mojom";
|
|
|
|
import "mojo/public/mojom/base/string16.mojom";
|
|
|
|
import "mojo/public/mojom/base/values.mojom";
|
|
|
|
import "services/network/public/mojom/site_for_cookies.mojom";
|
|
|
|
import "services/network/public/mojom/url_request.mojom";
|
|
|
|
import "third_party/blink/public/mojom/loader/referrer.mojom";
|
2024-01-26 03:12:43 +01:00
|
|
|
import "third_party/blink/public/mojom/tokens/tokens.mojom";
|
2021-05-14 18:58:55 +02:00
|
|
|
import "ui/gfx/geometry/mojom/geometry.mojom";
|
|
|
|
import "url/mojom/url.mojom";
|
|
|
|
|
|
|
|
// Structure passed to UpdateDraggableRegions().
|
|
|
|
struct DraggableRegionEntry {
|
|
|
|
gfx.mojom.Rect bounds;
|
|
|
|
bool draggable;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Structure passed to LoadRequest().
|
|
|
|
struct RequestParams {
|
|
|
|
// Request method.
|
|
|
|
string method;
|
|
|
|
|
|
|
|
// The URL to be loaded.
|
|
|
|
url.mojom.Url url;
|
|
|
|
|
|
|
|
// The referrer for the request.
|
|
|
|
blink.mojom.Referrer referrer;
|
|
|
|
|
|
|
|
// Usually the URL of the document in the top-level window, which may be
|
|
|
|
// checked by the third-party cookie blocking policy. Leaving it empty may
|
|
|
|
// lead to undesired cookie blocking. Third-party cookie blocking can be
|
|
|
|
// bypassed by setting site_for_cookies = url, but this should ideally
|
|
|
|
// only be done if there really is no way to determine the correct value.
|
|
|
|
network.mojom.SiteForCookies site_for_cookies;
|
|
|
|
|
|
|
|
// Additional HTTP request headers.
|
|
|
|
string headers;
|
|
|
|
|
|
|
|
// net::URLRequest load flags (0 by default).
|
|
|
|
int32 load_flags;
|
|
|
|
|
|
|
|
// Upload data (may be empty).
|
|
|
|
network.mojom.URLRequestBody? upload_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Interface for communicating with a frame in the renderer process.
|
|
|
|
interface RenderFrame {
|
2022-02-10 22:52:36 +01:00
|
|
|
// Browser process has received the FrameAttached() message.
|
2024-04-17 18:01:26 +02:00
|
|
|
// |allow| will be false if we don't want to attach the frame.
|
|
|
|
FrameAttachedAck(bool allow);
|
2022-02-10 22:52:36 +01:00
|
|
|
|
2022-08-16 20:47:47 +02:00
|
|
|
// Browser process has intentionally detached.
|
|
|
|
FrameDetached();
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
// Send a message to the render process.
|
2023-01-30 22:42:40 +01:00
|
|
|
SendMessage(string name, mojo_base.mojom.ListValue arguments);
|
2021-05-14 18:58:55 +02:00
|
|
|
|
2022-07-04 11:49:15 +02:00
|
|
|
// Send a shared memory region to the render process.
|
2023-10-17 00:43:29 +02:00
|
|
|
SendSharedMemoryRegion(string name, mojo_base.mojom.WritableSharedMemoryRegion region);
|
2022-07-04 11:49:15 +02:00
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
// Send a command.
|
|
|
|
SendCommand(string command);
|
|
|
|
|
|
|
|
// Send a command that returns an async response.
|
|
|
|
// The returned |response| format is command-specific and will be invalid if
|
|
|
|
// an error occurred.
|
|
|
|
SendCommandWithResponse(string command) =>
|
|
|
|
(mojo_base.mojom.ReadOnlySharedMemoryRegion? response);
|
|
|
|
|
|
|
|
// Send JavaScript for execution.
|
|
|
|
SendJavaScript(mojo_base.mojom.String16 jsCode, string scriptUrl,
|
|
|
|
int32 startLine);
|
|
|
|
|
|
|
|
// Load a request.
|
|
|
|
LoadRequest(RequestParams params);
|
|
|
|
|
|
|
|
// Loading has stopped.
|
|
|
|
DidStopLoading();
|
2023-01-06 19:33:32 +01:00
|
|
|
|
|
|
|
// Move or resize of the renderer's containing window has started. Used on
|
|
|
|
// Windows and Linux with the Alloy runtime.
|
|
|
|
MoveOrResizeStarted();
|
2021-05-14 18:58:55 +02:00
|
|
|
};
|
|
|
|
|
2022-02-10 22:52:36 +01:00
|
|
|
// Interface for communicating with a frame in the browser process.
|
|
|
|
interface BrowserFrame {
|
|
|
|
// Send a message to the browser process.
|
2023-01-30 22:42:40 +01:00
|
|
|
SendMessage(string name, mojo_base.mojom.ListValue arguments);
|
2022-02-10 22:52:36 +01:00
|
|
|
|
2022-07-04 11:49:15 +02:00
|
|
|
// Send a shared memory region to the browser process.
|
2023-10-17 00:43:29 +02:00
|
|
|
SendSharedMemoryRegion(string name, mojo_base.mojom.WritableSharedMemoryRegion region);
|
2022-07-04 11:49:15 +02:00
|
|
|
|
2022-02-10 22:52:36 +01:00
|
|
|
// The render frame is ready to begin handling actions.
|
|
|
|
FrameAttached(pending_remote<RenderFrame> render_frame,
|
|
|
|
bool reattached);
|
|
|
|
|
|
|
|
// Draggable regions have updated.
|
|
|
|
UpdateDraggableRegions(array<DraggableRegionEntry>? regions);
|
|
|
|
};
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
struct CrossOriginWhiteListEntry {
|
|
|
|
string source_origin;
|
|
|
|
string target_protocol;
|
|
|
|
string target_domain;
|
|
|
|
bool allow_target_subdomains;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewRenderThreadInfo {
|
|
|
|
array<CrossOriginWhiteListEntry>? cross_origin_whitelist_entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBrowserInfo {
|
|
|
|
int32 browser_id;
|
2024-04-17 18:01:26 +02:00
|
|
|
bool? is_popup;
|
|
|
|
bool? is_windowless;
|
|
|
|
bool? print_preview_enabled;
|
2024-04-24 23:23:47 +02:00
|
|
|
bool is_excluded;
|
2023-01-30 22:42:40 +01:00
|
|
|
mojo_base.mojom.DictionaryValue? extra_info;
|
2021-05-14 18:58:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Interface for communicating with browser management in the browser process.
|
|
|
|
interface BrowserManager {
|
|
|
|
// Retrieve info for a new RenderThread.
|
|
|
|
[Sync]
|
|
|
|
GetNewRenderThreadInfo() => (NewRenderThreadInfo info);
|
|
|
|
|
|
|
|
// Retrieve info for a new CefBrowser.
|
|
|
|
[Sync]
|
2024-01-26 03:12:43 +01:00
|
|
|
GetNewBrowserInfo(blink.mojom.LocalFrameToken render_frame_token) =>
|
|
|
|
(NewBrowserInfo info);
|
2021-05-14 18:58:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Interface for communicating with browser management to the render process.
|
|
|
|
interface RenderManager {
|
|
|
|
// Manage cross-origin whitelist contents during the render process lifespan.
|
|
|
|
ModifyCrossOriginWhitelistEntry(bool add, CrossOriginWhiteListEntry entry);
|
|
|
|
ClearCrossOriginWhitelist();
|
|
|
|
};
|