cef/libcef/common/mojom/cef.mojom

144 lines
4.5 KiB
Plaintext
Raw Normal View History

// 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";
import "third_party/blink/public/mojom/tokens/tokens.mojom";
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 {
// Browser process has received the FrameAttached() message.
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
// |allow| will be false if we don't want to attach the frame.
FrameAttachedAck(bool allow);
// Browser process has intentionally detached.
FrameDetached();
// Send a message to the render process.
SendMessage(string name, mojo_base.mojom.ListValue arguments);
// Send a shared memory region to the render process.
SendSharedMemoryRegion(string name, mojo_base.mojom.WritableSharedMemoryRegion region);
// 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();
// Move or resize of the renderer's containing window has started. Used on
// Windows and Linux with the Alloy runtime.
MoveOrResizeStarted();
};
// Interface for communicating with a frame in the browser process.
interface BrowserFrame {
// Send a message to the browser process.
SendMessage(string name, mojo_base.mojom.ListValue arguments);
// Send a shared memory region to the browser process.
SendSharedMemoryRegion(string name, mojo_base.mojom.WritableSharedMemoryRegion region);
// 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);
};
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;
chrome: Add support for Alloy style browsers and windows (see #3681) Split the Alloy runtime into bootstrap and style components. Support creation of Alloy style browsers and windows with the Chrome runtime. Chrome runtime (`--enable-chrome-runtime`) + Alloy style (`--use-alloy-style`) supports Views (`--use-views`), native parent (`--use-native`) and windowless rendering (`--off-screen-rendering-enabled`). Print preview is supported in all cases except with windowless rendering on all platforms and native parent on MacOS. It is disabled by default with Alloy style for legacy compatibility. Where supported it can be enabled or disabled globally using `--[enable|disable]-print-preview` or configured on a per-RequestContext basis using the `printing.print_preview_disabled` preference. It also behaves as expected when triggered via the PDF viewer print button. Chrome runtime + Alloy style behavior differs from Alloy runtime in the following significant ways: - Supports Chrome error pages by default. - DevTools popups are Chrome style only (cannot be windowless). - The Alloy extension API will not supported. Chrome runtime + Alloy style passes all expected Alloy ceftests except the following: - `DisplayTest.AutoResize` (Alloy extension API not supported) - `DownloadTest.*` (Download API not yet supported) - `ExtensionTest.*` (Alloy extension API not supported) This change also adds Chrome runtime support for CefContextMenuHandler::RunContextMenu (see #3293). This change also explicitly blocks (and doesn't retry) FrameAttached requests from PDF viewer and print preview excluded frames (see #3664). Known issues specific to Chrome runtime + Alloy style: - DevTools popup with windowless rendering doesn't load successfully. Use windowed rendering or remote debugging as a workaround. - Chrome style Window with Alloy style BrowserView (`--use-alloy-style --use-chrome-style-window`) does not show Chrome theme changes. To test: - Run `ceftests --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native] --gtest_filter=...` - Run `cefclient --enable-chrome-runtime --use-alloy-style [--use-chrome-style-window] [--use-views|--use-native|--off-screen-rendering-enabled]` - Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-17 18:01:26 +02:00
bool? is_popup;
bool? is_windowless;
bool? print_preview_enabled;
bool is_excluded;
mojo_base.mojom.DictionaryValue? extra_info;
};
// 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]
GetNewBrowserInfo(blink.mojom.LocalFrameToken render_frame_token) =>
(NewBrowserInfo info);
};
// 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();
};