| Index: third_party/WebKit/Source/core/editing/TextSuggestionController.h
|
| diff --git a/third_party/WebKit/Source/core/editing/TextSuggestionController.h b/third_party/WebKit/Source/core/editing/TextSuggestionController.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fd931480769ba5257dddc536f76ea5ffad808a3c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/editing/TextSuggestionController.h
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef TextSuggestionController_h
|
| +#define TextSuggestionController_h
|
| +
|
| +#include "core/CoreExport.h"
|
| +#include "core/editing/TextSuggestionInfo.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "public/platform/WebVector.h"
|
| +#include "public/platform/input_host.mojom-blink.h"
|
| +#include "public/web/WebTextSuggestionInfo.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class Document;
|
| +class LocalFrame;
|
| +
|
| +class CORE_EXPORT TextSuggestionController final
|
| + : public GarbageCollectedFinalized<TextSuggestionController> {
|
| + WTF_MAKE_NONCOPYABLE(TextSuggestionController);
|
| +
|
| + public:
|
| + static TextSuggestionController* create(LocalFrame&);
|
| + DECLARE_TRACE();
|
| +
|
| + bool suggestionMenuIsOpen() const;
|
| +
|
| + void applySuggestionReplacement(int documentMarkerID, int suggestionIndex);
|
| + void deleteSuggestionHighlight();
|
| + void suggestionMenuClosed();
|
| +
|
| + void handlePotentialTextSuggestionTap();
|
| + void prepareForTextSuggestionMenuToBeShown();
|
| + void removeSuggestionMarkersAffectedByEditing(
|
| + bool doNotRemoveIfSelectionAtWordBoundary);
|
| +
|
| + private:
|
| + Document& document() const;
|
| + bool isAvailable() const;
|
| +
|
| + LocalFrame& frame() const {
|
| + DCHECK(m_frame);
|
| + return *m_frame;
|
| + }
|
| +
|
| + explicit TextSuggestionController(LocalFrame& frame);
|
| +
|
| + Vector<blink::TextSuggestionInfo>
|
| + getTextSuggestionInfosUnderCaretAndAddHighlight() const;
|
| +
|
| + bool m_suggestionMenuIsOpen;
|
| + Member<LocalFrame> m_frame;
|
| + mojom::blink::TextSuggestionHostPtr text_suggestion_host_;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // TextSuggestionController_h
|
|
|