| // Copyright 2019 The Chromium 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 blink.mojom; |
| |
| import "mojo/public/mojom/base/string16.mojom"; |
| import "third_party/blink/public/mojom/frame/fullscreen.mojom"; |
| import "url/mojom/origin.mojom"; |
| import "url/mojom/url.mojom"; |
| |
| // Implemented in Browser, this interface defines frame-specific methods that will |
| // be invoked from the render process (e.g. content::RenderFrameHostImpl). |
| // |
| // Note that this is different than content/common/frame.mojom in that the |
| // methods defined here are called directly in Blink without passing through |
| // content. In the future this interface will likely host more methods as the |
| // Onion Soup project advances, which can potentially lead to the removal of |
| // content/common/frame.mojom if enough code is moved to Blink. |
| interface LocalFrameHost { |
| |
| // Request to the browser that the frame wishes to enter fullscreen mode. |
| EnterFullscreen(FullscreenOptions options); |
| |
| // Request to the browser to exit fullscreen mode. |
| ExitFullscreen(); |
| |
| // Notifies the browser that the current frame has either become or is no |
| // longer fullscreen. |
| FullscreenStateChanged(bool is_fullscreen); |
| |
| // Register a new handler for URL requests with the given scheme. |scheme|, |
| // |url|, and |title| are provided directly from javascript. See |
| // https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers |
| // |user_gesture| indicates if the javascript API was called in context of |
| // having an active transient user gesture. |
| RegisterProtocolHandler(string scheme, url.mojom.Url url, |
| mojo_base.mojom.String16 title, bool user_gesture); |
| |
| // Unregister the registered handler for URL requests with the given scheme. |
| // |scheme|, and |url| are provided directly from javascript. See |
| // https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers |
| // |user_gesture| indicates if the javascript API was called in context of |
| // having an active transient user gesture. |
| UnregisterProtocolHandler(string scheme, url.mojom.Url url, bool user_gesture); |
| |
| // Indication that the associated frame has displayed inactive content |
| // (such as an image) from an insecure source. Inactive content cannot spread |
| // to other frames. |
| DidDisplayInsecureContent(); |
| |
| // Indication that the associated frame contains a form that submits to an |
| // insecure target url. |
| DidContainInsecureFormAction(); |
| |
| // Indicates that a child frame requires its parent frame to send it information |
| // about whether it is occluded or has visual effects applied, in order to |
| // service IntersectionObserver's that track visibility. |
| SetNeedsOcclusionTracking(bool needs_tracking); |
| }; |
| |
| // Implemented in Blink, this interface defines frame-specific methods that will |
| // be invoked from the browser process (e.g. content::RenderFrameHostImpl). |
| // |
| // Note that this is different than content/common/frame.mojom in that the |
| // methods defined here are handled directly in Blink without passing through |
| // content. In the future this interface will likely host more methods as the |
| // Onion Soup project advances, which can potentially lead to the removal of |
| // content/common/frame.mojom if enough code is moved to Blink. |
| interface LocalFrame { |
| // Retrieves the text surrounding the current selection for the frame up to |
| // the length specified by |max_length|, along with its start and end offsets. |
| GetTextSurroundingSelection(uint32 max_length) |
| => (mojo_base.mojom.String16 content, uint32 start_offset, |
| uint32 end_offset); |
| |
| // Creates an intervention report in the frame with contents |id| and |
| // |message|, returns once the report has been queued. |id| identifies the |
| // intervention that occurred. |message| is a human-readable string that |
| // can provide additional context to the cause of the intervention. |
| SendInterventionReport(string id, string message); |
| }; |
| |
| // Implemented in Blink, this interface defines frame-specific methods that will |
| // be invoked from the browser process (e.g. content::RenderFrameProxyHost). |
| // |
| // Note that this is different than content/common/frame.mojom in that the |
| // methods defined here are handled directly in Blink without passing through |
| // content. In the future this interface will likely host more methods as the |
| // Onion Soup project advances, which can potentially lead to the removal of |
| // content/common/frame.mojom if enough code is moved to Blink. |
| interface RemoteFrame { |
| // Sent to a frame proxy when its real frame is preparing to enter fullscreen |
| // in another process. Actually entering fullscreen will be done separately as |
| // part of ViewMsg_Resize, once the browser process has resized the tab for |
| // fullscreen. |
| WillEnterFullscreen(); |
| }; |