blob: 786e5f92021b3ebaef0b6e73e97bd5d197c3899f [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 remote_cocoa.mojom;
import "components/remote_cocoa/common/alert.mojom";
import "components/remote_cocoa/common/color_panel.mojom";
import "components/remote_cocoa/common/native_widget_ns_window.mojom";
import "components/remote_cocoa/common/native_widget_ns_window_host.mojom";
import "components/remote_cocoa/common/text_input_host.mojom";
// Empty interface that is used by Application in place of
// RenderWidgetHostNSViewBridge, RenderWidgetHostNSViewClient,
// WebContentsNSViewBridge, and WebContentsNSViewClient (which are the real
// interfaces that should be used). The reason that the correct interfaces
// cannot be used directly is that they have dependencies on types that are in
// content.
// TODO(ccameron): Migrate the interfaces from content types to remote_cocoa
// types, and then move the interfaces to this component.
// https://crbug.com/888290
interface StubInterface {};
// The interface through which the browser controls the NSApplication in an
// app shim process. This also the root interface to Cocoa, through which
// various Cocoa types (NSAlert, NSWindow, NSView, etc) are created.
interface Application {
// Create a bridge for an NSAlert. The resulting object owns its own lifetime.
CreateAlert(AlertBridge& alert_bridge_request);
// Show the NSColorPanel in this application.
ShowColorPanel(ColorPanel& request, ColorPanelHost host);
// Create a window for a native widget. The resulting object will be owned by
// the connection for |host|. Closing that connection will result in deleting
// the bridge.
CreateNativeWidgetNSWindow(
uint64 bridge_id,
associated NativeWidgetNSWindow& window_request,
associated NativeWidgetNSWindowHost host,
associated TextInputHost text_input_host);
// Create and take ownership of the NSView for a RenderWidgetHostView. The
// resulting object will be destroyed when the connection is closed.
CreateRenderWidgetHostNSView(
associated StubInterface host,
associated StubInterface& view_request);
// Create and take ownership of the NSView for a WebContentsView. The
// resulting object will be destroyed when the connection is closed.
// The value of |view_id| may be used to look up the NSView (e.g, to add
// child NSViews.
CreateWebContentsNSView(
uint64 view_id,
associated StubInterface host,
associated StubInterface& view_request);
};