1// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5module blink.mojom;
6
7import "ui/gfx/geometry/mojom/geometry.mojom";
8
9enum ViewportFit {
10  // No effect - the whole web page is viewable (default).
11  kAuto,
12
13  // The initial layout viewport and the visual viewport are set to the
14  // largest rectangle which is inscribed in the display of the device.
15  kContain,
16
17  // The initial layout viewport and the visual viewport are set to the
18  // circumscribed rectangle of the physical screen of the device.
19  kCover,
20
21  // This has the same behaviour as |kCover| but it identifies that the
22  // ViewportFit value was forced by the user agent by the media controls.
23  kCoverForcedByUserAgent,
24};
25
26// Used for renderer -> browser calls about display cutout.
27interface DisplayCutoutHost {
28  // Notify the browser that the ViewportFit for the renderer has changed.
29  NotifyViewportFitChanged(blink.mojom.ViewportFit value);
30};
31
32// Contains the four safe areas for the display cutout. These are insets from
33// each edge of the display measured in pixels.
34// TODO(beccahughes): Replace with gfx::Insets
35struct DisplayCutoutSafeArea {
36  int32 top;
37  int32 left;
38  int32 bottom;
39  int32 right;
40};
41
42// Used for browser -> renderer calls about display cutout. This is associated
43// with a frame.
44interface DisplayCutoutClient {
45  // Notify the renderer that the safe areas have changed.
46  SetSafeArea(DisplayCutoutSafeArea safe_area);
47};
48