File: application.mojom

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (74 lines) | stat: -rw-r--r-- 3,549 bytes parent folder | download | duplicates (7)
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
// Copyright 2018 The Chromium Authors
// 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/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";
import "components/system_media_controls/mac/remote_cocoa/system_media_controls.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 {};

// Enum describing what edit command is being forwarded to the NSApplication.
enum CutCopyPasteCommand {
  kCut, kCopy, kPaste
};

// 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(pending_receiver<AlertBridge> alert_bridge_receiver);

  // 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,
      pending_associated_receiver<NativeWidgetNSWindow> window_receiver,
      pending_associated_remote<NativeWidgetNSWindowHost> host,
      pending_associated_remote<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.
  // The value of |view_id| may be used to look up the NSView (e.g, to add
  // child NSViews or get a point relative to that NSView).
  CreateRenderWidgetHostNSView(
      uint64 view_id,
      pending_associated_remote<StubInterface> host,
      pending_associated_receiver<StubInterface> view_receiver);

  // Create and take ownership of a SystemMediaControlsBridge for a
  // SystemMediaControlsMac. The resulting object will live as long as the
  // Application lives. Any subsequent calls to this function on the same
  // Application will reconnect the existing SystemMediaControlsBridge to the
  // new pending receiver/host.
  CreateSystemMediaControlsBridge(
    pending_receiver<system_media_controls.mojom.SystemMediaControls> receiver,
    pending_remote<system_media_controls.mojom.SystemMediaControlsObserver> host);

  // 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,
      pending_associated_remote<StubInterface> host,
      pending_associated_receiver<StubInterface> view_receiver);

  // Forwards a Cut, Copy or Paste operation to the NSApplication.
  ForwardCutCopyPaste(CutCopyPasteCommand command);
};