Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: third_party/WebKit/Source/core/editing/TextSuggestionController.h

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Uploading the latest version from my repo so I can reference it Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698