chromium/chromeos/ash/services/ime/public/mojom/connection_factory.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.

// Updates to this file must be backwards-compatible, as it is used outside of
// the Chromium repo. This file should be updated first, before syncing in the
// other repos.

// Next MinVersion: 4

module ash.ime.mojom;

import "chromeos/ash/services/ime/public/mojom/input_method.mojom";
import "chromeos/ash/services/ime/public/mojom/input_method_host.mojom";
import "chromeos/ash/services/ime/public/mojom/japanese_settings.mojom";

// Responsible for instantiating the connection between the shared library
// and Chromium over an associated Mojo pipe.
[Stable]
interface ConnectionFactory {
  // Connects to the given input method identified by |ime_spec|.
  // |input_method_host| runs in the browser process and is used by the input
  // method to communicate with the text field and the system.
  // On success, return |success| as true, and |input_method| can be used to
  // interact with the input method.
  // On failure (e.g. |ime_spec| is not valid), |success| is false.
  // TODO(b/214153032): Split this into ConnectToMojoModeSharedLibInputMethod()
  // and ConnectToRuleBasedInputMethod(), to better manage two distinct kinds of
  // connections this does. Also, paraphrase documentation accordingly.
  ConnectToInputMethod@0(
    string ime_spec,
    pending_associated_receiver<InputMethod> input_method,
    pending_associated_remote<InputMethodHost> input_method_host,
    [MinVersion=2] InputMethodSettings? settings)
    => (bool success);

  // This holds a Japanese related function that was never used.
  [MinVersion=3] Unused@1(
    pending_associated_receiver<JpUnused> unused)
    => (bool success);
};