Index: third_party/WebKit/Source/core/editing/TextSuggestionBackendImpl.cpp |
diff --git a/third_party/WebKit/Source/core/editing/TextSuggestionBackendImpl.cpp b/third_party/WebKit/Source/core/editing/TextSuggestionBackendImpl.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e7cc7b65ef5b2fe58ff47f9c4a81ff421a9b91a3 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/editing/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/TextSuggestionBackendImpl.h" |
+ |
+#include "core/editing/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 |