File: chrome_render_frame.mojom

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (116 lines) | stat: -rw-r--r-- 5,278 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module chrome.mojom;

[EnableIfNot=is_android]
import "chrome/common/actor.mojom";
import "components/lens/lens_metadata.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "skia/public/mojom/bitmap.mojom";
import "third_party/blink/public/mojom/window_features/window_features.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "url/mojom/url.mojom";

const int32 kDefaultQuality = 90;

enum ImageFormat {
  JPEG,
  PNG,
  WEBP,
  // ORIGINAL means request basic image formats, JPG/PNG/GIF, if the original
  // image format is not one of them, encode the image to JPG and return.
  ORIGINAL,
};

// Messages sent from chrome to the render frame.
interface ChromeRenderFrame {
  // Updates the window features of the main frame's render view.
  SetWindowFeatures(blink.mojom.WindowFeatures window_features);

  // Reloads the image selected by the most recently opened context menu
  // (if there indeed is an image at that location).
  RequestReloadImageForContextNode();

  // Requests the bitmap selected by the most recently opened context menu.
  RequestBitmapForContextNode() => (skia.mojom.BitmapN32? bitmap);

  // Requests the bitmap and bounds of the image selected by the most recently
  // opened context menu. Note that the bounds originate from the DOM layer, are
  // in DIP and are relative to the local root's widget
  // (see Element::BoundsInWidget()). No guarantee is made about their
  // correlation with the bounds of the image as displayed in the presentation
  // layer. The returned bounds are also not guaranteed to correspond to the
  // result of returned image.
  RequestBitmapForContextNodeWithBoundsHint()
      => (skia.mojom.BitmapN32? bitmap, gfx.mojom.Rect bounds);

  // Requests the bounds of all images found in the DOM of the render frame.
  // Note that the bounds originate from the DOM layer, use window coordinates
  // which are device scale independent, and have been adjusted to include
  // any transformations, including page scale. No guarantee is made about
  // their correlation with the bounds of the image as displayed in the
  // presentation layer. The returned bounds are also not guaranteed to
  // correspond to the result of calling RequestBitmapForContextNode() on each
  // image.
  RequestBoundsHintForAllImages() => (array<gfx.mojom.Rect> all_bounds);

  // Requests an encoded image selected by the most recently opened context
  // menu. The encoding format is specified as a parameter. If no image is
  // selected or there's an error capturing the image, |image_data| will be
  // empty. If the image area is larger than |image_min_area_pixels| it will be
  // downscaled to fit within |image_max_size_pixels|.
  // If |image_format| is ORIGINAL, return original image data except image
  // larger than size specified as a parameter. In that case, returns a resized
  // JPEG static image. |quality| is an integer between 0-100 where 100
  // is the highest quality. Higher encoding quality results in a better visual
  // image, but takes longer to encode and yields a larger image.
  // |quality| only affects lossy |image_formats| (aka JPEG/WebP).
  RequestImageForContextNode(int32 image_min_area_pixels,
                             gfx.mojom.Size image_max_size_pixels,
                             ImageFormat image_format,
                             int32 quality)
      => (array<uint8> image_data,
          gfx.mojom.Size original_size,
          gfx.mojom.Size downscaled_size,
          string encoded_extension,
          array<lens.mojom.LatencyLog> log_data);

  // For WebUI testing, this message requests JavaScript to be executed at a
  // time which is late enough to not be thrown out, and early enough to be
  // before onload events are fired.
  ExecuteWebUIJavaScript(mojo_base.mojom.String16 javascript);

  // Sets a header identifying the CCT session.
  [EnableIf=is_android]
  SetCCTClientHeader(string header);

  // Requests the Media Feed Url from the renderer (if the page has one).
  GetMediaFeedURL() => (url.mojom.Url? url);

  // Tells the render frame to load any blocked plugins matching the given
  // identifier (empty string matches all).
  LoadBlockedPlugins(string identifier);

  // Indicates that the frame should collect draggable regions set using the
  // app-region CSS property.
  SetSupportsDraggableRegions(bool supports_draggable_regions);

  // Sets whether the frame needs to defer media loading when it is in
  // background.
  SetShouldDeferMediaLoad(bool should_defer);

  // Requests invoking of a tool from the actor automation framework. See
  // chrome/browser/actor
  [EnableIfNot=is_android]
  InvokeTool(actor.mojom.ToolInvocation request) =>
      (actor.mojom.ActionResult result);

  // Requests actor automation framework journaling. Journaling can be
  // stopped by disconnecting the passed in remote. We use an associated
  // remote here to keep this consistent with navigation events. The
  // journal will record the last committed URL in the logs.
  [EnableIfNot=is_android] StartActorJournal(
    pending_associated_remote<actor.mojom.JournalClient> client);
};