chromium/chromeos/crosapi/mojom/embedded_accessibility_helper.mojom

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

module crosapi.mojom;

import "ui/gfx/geometry/mojom/geometry.mojom";

// Interface for EmbeddedAccessibilityHelperClients. Implemented by ash-chrome.
// Used by lacros-chrome (the "embedded helper") to inform when accessibility
// features have received certain events from lacros-chrome so that
// features can act on these events.
// Next version: 2
// Next method id: 2
[Stable, Uuid="5d670d98-5c5f-4805-ba83-b77690f5f68c"]
interface EmbeddedAccessibilityHelperClient {
 // Called by lacros-chrome when a context menu (added with chrome.contextMenus
 // API) is clicked for the Select to Speak feature to request that selected
 // text is spoken out loud for the user. This is in place of unsupported
 // chrome.contextMenus, which is not piped through for Ash extension APIs to
 // act in lacros-chrome.
 SpeakSelectedText@0();

 // Called by lacros-chrome when the focus has changed in the lacros browser
 // and the focus highlight feature is enabled. Sends the bounds of the
 // currently focused element to ash-chrome.
 [MinVersion=1] FocusChanged@1(gfx.mojom.Rect focus_bounds_in_screen);
};

// Interface for EmbeddedAccessibilityHelpers. Implemented by lacros-chrome.
// Used by ash-chrome for accessibility features in Ash that need actions
// performed in lacros-chrome.
[Stable, Uuid="f259d816-7530-4fcc-9836-0e2996d395ec"]
interface EmbeddedAccessibilityHelper {
  // Called when Select to Speak in Ash wants a clipboard copy
  // event to be performed on the active and focused tab with the
  // given URL. This is fired when Select to Speak is trying to speak
  // with search+s but cannot find a selection and the focused node
  // is in a Google Docs page.
  ClipboardCopyInActiveGoogleDoc@0(string url);
};

// A factory living in ash-chrome which brokers connections to other
// processes for EmbeddedAccessibilityHelper and
// EmbeddedAccessibilityHelperClient.
// Next version: 2
// Next method id: 2
[Stable, Uuid="b6216633-c0d5-4eab-848e-d9fdfeaa3c33"]
interface EmbeddedAccessibilityHelperClientFactory {
  // Binds EmbeddedAccessibilityHelperClient's receiver in lacros-chrome.
  BindEmbeddedAccessibilityHelperClient@0(
    pending_receiver<EmbeddedAccessibilityHelperClient>
        embedded_ax_helper_client);

  // Binds EmbeddedAccessibilityHelper's remote in lacros-chrome.
  [MinVersion=1] BindEmbeddedAccessibilityHelper@1(
    pending_remote<EmbeddedAccessibilityHelper> embedded_ax_helper);
};