chromium/extensions/common/mojom/renderer_host.mojom

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

module extensions.mojom;

import "mojo/public/mojom/base/values.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "url/mojom/url.mojom";

// Channel-associated interface implemented by the browser process. It should be
// used for implementing renderer-to-browser messages which need to retain FIFO
// with respect to other mojo interfaces like content.mojom.RendererHost.
interface RendererHost {
  // Log an API action to the extension activity log.
  // `extra` holds extra logging information.
  AddAPIActionToActivityLog(string extension_id,
                            string call_name,
                            mojo_base.mojom.ListValue args,
                            string extra);

  // Log an event to the extension activity log.
  // `extra` holds extra logging information.
  AddEventToActivityLog(string extension_id,
                        string call_name,
                        mojo_base.mojom.ListValue args,
                        string extra);

  // Log a DOM action to the extension activity log.
  AddDOMActionToActivityLog(string extension_id,
                            string call_name,
                            mojo_base.mojom.ListValue args,
                            url.mojom.Url url,
                            mojo_base.mojom.String16 url_title,
                            int32 call_type);

  // Retrieves the message bundle for an extension from the browser.
  [Sync]
  GetMessageBundle(string extension_id) => (map<string, string> message_map);
};