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

Unified Diff: third_party/WebKit/Source/core/editing/suggestion/TextSuggestionBackendImpl.cpp

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Respond to latest comments Created 3 years, 5 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/suggestion/TextSuggestionBackendImpl.cpp
diff --git a/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionBackendImpl.cpp b/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionBackendImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3ac892401db7279fd8b385746470d40106a51c44
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionBackendImpl.cpp
@@ -0,0 +1,47 @@
+// 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.
+
+#include "core/editing/suggestion/TextSuggestionBackendImpl.h"
+
+#include "core/editing/suggestion/TextSuggestionController.h"
+#include "core/frame/LocalFrame.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace blink {
+
+TextSuggestionBackendImpl::TextSuggestionBackendImpl(LocalFrame& frame)
+ : frame_(frame) {}
+
+// static
+void TextSuggestionBackendImpl::Create(
+ LocalFrame* frame,
+ mojom::blink::TextSuggestionBackendRequest request) {
+ mojo::MakeStrongBinding(std::unique_ptr<TextSuggestionBackendImpl>(
+ new TextSuggestionBackendImpl(*frame)),
+ std::move(request));
+}
+
+void TextSuggestionBackendImpl::ApplySpellCheckSuggestion(
+ const WTF::String& suggestion) {
+ frame_->GetTextSuggestionController().ApplySpellCheckSuggestion(suggestion);
+}
+
+void TextSuggestionBackendImpl::DeleteActiveSuggestionRange() {
+ frame_->GetTextSuggestionController().DeleteActiveSuggestionRange();
+}
+
+void TextSuggestionBackendImpl::NewWordAddedToDictionary(
+ const WTF::String& word) {
+ frame_->GetTextSuggestionController().NewWordAddedToDictionary(word);
+}
+
+void TextSuggestionBackendImpl::SpellCheckMenuTimeoutCallback() {
+ frame_->GetTextSuggestionController().SpellCheckMenuTimeoutCallback();
+}
+
+void TextSuggestionBackendImpl::SuggestionMenuClosed() {
+ frame_->GetTextSuggestionController().SuggestionMenuClosed();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698