chromium/chrome/common/extensions/api/accessibility_service_private.idl

// 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.

// API which provides support for ChromeOS Accessibility features in the
// browser.

[platforms=("chromeos", "lacros"),
  implemented_in="chrome/browser/chromeos/extensions/accessibility_service_private.h"]

namespace accessibilityServicePrivate {
  callback VoidCallback = void();

  interface Functions {
    // Called when Select to Speak in ChromeOS should speak the current
    // text selection; fired when the context menu option was clicked in
    // a selection context.
    static void speakSelectedText(
      optional VoidCallback callback);
  };

  interface Events {
    // Called when Select to Speak in ChromeOS 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.
    static void clipboardCopyInActiveGoogleDoc(DOMString url);
  };
};