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

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

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Created 3 years, 6 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..20063a5d0c0cae98e801e3a01183a39492f57535
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/TextSuggestionController.h
@@ -0,0 +1,54 @@
+// 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 "platform/heap/Handle.h"
+#include "public/platform/input_host.mojom-blink.h"
+
+namespace blink {
+
+class Document;
+class LocalFrame;
+
+class CORE_EXPORT TextSuggestionController final
yosin_UTC9 2017/06/07 01:34:15 Could you add a class comment?
+ : public GarbageCollectedFinalized<TextSuggestionController> {
+ WTF_MAKE_NONCOPYABLE(TextSuggestionController);
+
+ public:
+ explicit TextSuggestionController(LocalFrame&);
+
+ bool IsMenuOpen() const;
+
+ void HandlePotentialMisspelledWordTap();
+
+ void ApplySpellCheckSuggestion(const WTF::String& suggestion);
+ void DeleteActiveSuggestionRange();
+ void NewWordAddedToDictionary(const WTF::String& word);
+ void SpellCheckMenuTimeoutCallback();
+ void SuggestionMenuClosed();
+
+ DECLARE_TRACE();
+
+ private:
+ Document& GetDocument() const;
+ bool IsAvailable() const;
+
+ LocalFrame& GetFrame() const {
+ DCHECK(frame_);
+ return *frame_;
+ }
+
+ void ReplaceActiveSuggestionRange(const String&);
+
+ bool suggestion_menu_is_open_;
+ Member<LocalFrame> frame_;
+ mojom::blink::TextSuggestionHostPtr text_suggestion_host_;
+};
+
+} // namespace blink
+
+#endif // TextSuggestionController_h

Powered by Google App Engine
This is Rietveld 408576698