// 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. #ifndef UI_BASE_IME_SURROUNDING_TEXT_TRACKER_H_ #define UI_BASE_IME_SURROUNDING_TEXT_TRACKER_H_ #include <deque> #include <string> #include <string_view> #include "base/component_export.h" #include "base/functional/callback.h" #include "third_party/abseil-cpp/absl/types/variant.h" #include "ui/base/ime/text_input_client.h" #include "ui/gfx/range/range.h" namespace ui { struct CompositionText; // Tracks the surrounding text. Because IMF works in an asynchronous manner, // there will be timing gap that IM-Engine sends some request to the text input // client, and the commit is actually notified. // This class gives it a try to fill the gap by caching and emulating the // latest surrounding text under the assumption that text editing requests are // processed in a common manner. class COMPONENT_EXPORT(UI_BASE_IME) SurroundingTextTracker { … }; } // namespace ui #endif // UI_BASE_IME_SURROUNDING_TEXT_TRACKER_H_