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

// Copyright 2020 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;

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

// Implemented in Browser, this interface defines methods that will be invoked
// from the render process for the reply to TextInputClientMac.
//
// Note that due to implementation details of TextInputClient on Mac this has
// stricter threading requirements. Also read the comment at the implementation
// (i.e. TextInputHostImpl).
interface TextInputHost {
  // Reply for GetCharacterIndexAtPoint from LocalFrame.
  // When GetCharacterIndexAtPoint is called in Browser, BrowserThread::UI is
  // blocked at TextInputClientMac to support the reply synchronously with
  // a timeout on Mac. So, it needs a separate message,
  // GotCharacterIndexAtPoint, that runs on BrowserThread::IO and unblocks
  // BrowserThread::UI.
  // [EnableIf=is_mac]
  GotCharacterIndexAtPoint(uint32 index);

  // Reply for GetFirstRectForRange from LocalFrame. It works in the same
  // manner as GetCharacterIndexAtPoint. The returned rect is in physical
  // pixels.
  // [EnableIf=is_mac]
  GotFirstRectForRange(gfx.mojom.Rect rect);
};