summaryrefslogtreecommitdiff
path: root/chromium/content/common/render_frame_metadata.mojom
blob: a2283f9d152a718068b060c65e5282be86b62055 (plain)
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
// Copyright 2018 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 content.mojom;

import "services/viz/public/interfaces/compositing/selection.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";

// See components/viz/service/quads/render_frame_metadata.h
struct RenderFrameMetadata {
  // The background color of a CompositorFrame. It can be used for filling the
  // content area if the primary surface is unavailable and fallback is not
  // specified.
  uint32 root_background_color;

  // Scroll offset of the root layer. This optional parameter is only sent
  // during tests.
  gfx.mojom.Vector2dF? root_scroll_offset;

  // Indicates whether the scroll offset of the root layer is at top, i.e.,
  // whether scroll_offset.y() == 0.
  bool is_scroll_offset_at_top;

  // Selection region relative to the current viewport. If the selection is
  // empty or otherwise unused, the bound types will indicate such.
  viz.mojom.Selection selection;
};

// This interface is provided by the renderer. It can optionally enable
// notifications for all frame submissions.
interface RenderFrameMetadataObserver {
  // When |enabled| is set to true, this will notify the associated client of
  // all frame submissions.
  ReportAllFrameSubmissionsForTesting(bool enabled);
};

// This interface is provided by the browser. It is notified of all changes to
// RenderFrameMetadata. It can be notified of all frame submissions, via
// RenderFrameMetadataObserver::ReportAllFrameSubmissionsForTesting.
interface RenderFrameMetadataObserverClient {
  // Notified when RenderFrameMetadata has changed.
  OnRenderFrameMetadataChanged(uint32 frame_token, RenderFrameMetadata metadata);

  // Notified on all frame submissions.
  OnFrameSubmissionForTesting(uint32 frame_token);
};