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

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: Fix dependency 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/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..ade3a210923c848c63e87ed5a5ca3d11b682d50a
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionBackendImpl.cpp
@@ -0,0 +1,46 @@
+// 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(WTF::MakeUnique<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