blob: 0cb86edb437f451962deb0e8103c06346ee69fa8 [file] [log] [blame]
// 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/content/public/mojom/navigable_contents.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
// Parameters used to configure a newly created NavigableContents.
struct NavigableContentsParams {
// Enables auto-resizing of any view created for this NavigableContents. If
// |true|, the corresponding NavigableContentsClient will receive
// |DidAutoResizeView()| notifications whenever such resizing happens.
bool enable_view_auto_resize = false;
// Specifies the minimum size for auto resizing.
// Defaults to (1, 1).
gfx.mojom.Size? auto_resize_min_size;
// Specifies the maximum size for auto resizing.
// Defaults to (INT_MAX, INT_MAX).
gfx.mojom.Size? auto_resize_max_size;
// Indicates that the client wants to control how navigation requests are
// handled within the created NavigableContents. Any attempt to navigate the
// NavigableContents by any means other than an explicit call to
// |NavigableContents.Navigate()| -- for example, link clicks or scripted
// location changes -- will be suppressed and will instead result in a
// |DidSuppressNavigation()| message being sent to the corresponding
// NavigableContentsClient.
bool suppress_navigations = false;
// Background color of the content. Effective when |override_background_color|
// is true.
// TODO( Numeric types are not nullable.
bool override_background_color = false;
uint32 background_color = 0xFFFFFFFF; // Opaque white.
// NavigableContentsFactory is the primary interface through which a new
// NavigableContents interface is bound to a new concrete navigable contents
// within the Content Service.
interface NavigableContentsFactory {
// Creates a new NavigableContents configured according to |params|.
// |receiver| is bound to a NavigableContents implementation, and |client| is
// used to push event notifications relevant to the state of that
// implementation throughout its lifetime.
CreateContents(NavigableContentsParams params,
pending_receiver<NavigableContents> receiver,
pending_remote<NavigableContentsClient> client);