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

ash / components / arc / mojom / error_notification.mojom [blame]

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Next MinVersion: 1
module arc.mojom;

[Extensible]
enum ErrorType {
  [Default] CRASH = 0,
  ANR = 1,
};

// Contains details of the error needed for general Chrome notifications.
struct ErrorDetails {
  string name; // app name or process name
  string title; // title of the Chrome notification
  ErrorType type;
  array<string>? buttonLabels;
};

// Next Method ID: 1
// Mojo interface exposed by the Chrome browser process for error notification,
// ARC is the client.
interface ErrorNotificationHost {
  // Sends the details of the error.
  SendErrorDetails@0(
      ErrorDetails details,
      pending_remote<ErrorNotificationActionHandler> action_handler)
      => (pending_remote<ErrorNotificationItem>? item);
};

// Next Method ID: 1
// Mojo interface exposed by ARC for Error Notifications, the Chrome browser
// process is the client.
interface ErrorNotificationInstance {
  // Establishes full-duplex communication with the host.
  Init@0(pending_remote<ErrorNotificationHost> host_remote) => ();
};

// Next Method ID: 1
// Mojo interface providing ARC the ability to request Chrome to manage
// displayed error notifications.
interface ErrorNotificationItem {
  // Instructs Chrome to dismiss a specific error notification.
  CloseErrorNotification@0();
};

// Next Method ID: 2
// Mojo interface through which Chrome communicates user interactions (clicks,
// closes) on error notifications back to ARC.
interface ErrorNotificationActionHandler {
  // Informs ARC that a button within the notification was clicked.
  OnNotificationButtonClicked@0(uint32 buttonIndex);

  // Informs ARC that the notification was dismissed by the user.
  OnNotificationClosed@1();
};