chromium/third_party/blink/public/mojom/input/input_host.mojom

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

module blink.mojom;

struct SpellCheckSuggestion {
  string suggestion;
};

struct TextSuggestion {
  int32 marker_tag;
  // This index is used by browser code as an opaque identifier to send back to
  // the renderer. It is not possible for the renderer to use it to cause an
  // out-of-bounds error in the browser.
  int32 suggestion_index;
  string prefix;
  string suggestion;
  string suffix;
};

// This interface runs in the browser. Blink editing code calls it to tell it
// when to display a spell check or text suggestion menu.
interface TextSuggestionHost {
  StartSuggestionMenuTimer();
  ShowSpellCheckSuggestionMenu(
    double caret_x,
    double caret_y,
    string marked_text,
    array<SpellCheckSuggestion> suggestions);
  ShowTextSuggestionMenu(
    double caret_x,
    double caret_y,
    string marked_text,
    array<TextSuggestion> suggestions);
};