OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/editing/TextSuggestionBackendImpl.h" |
| 6 |
| 7 #include "core/editing/TextSuggestionController.h" |
| 8 #include "core/frame/LocalFrame.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 TextSuggestionBackendImpl::TextSuggestionBackendImpl(LocalFrame& frame) |
| 14 : frame_(frame) {} |
| 15 |
| 16 // static |
| 17 void TextSuggestionBackendImpl::Create( |
| 18 LocalFrame* frame, |
| 19 mojom::blink::TextSuggestionBackendRequest request) { |
| 20 mojo::MakeStrongBinding(WTF::MakeUnique<TextSuggestionBackendImpl>(*frame), |
| 21 std::move(request)); |
| 22 } |
| 23 |
| 24 void TextSuggestionBackendImpl::ApplySpellCheckSuggestion( |
| 25 const WTF::String& suggestion) { |
| 26 frame_->GetTextSuggestionController().ApplySpellCheckSuggestion(suggestion); |
| 27 } |
| 28 |
| 29 void TextSuggestionBackendImpl::DeleteActiveSuggestionRange() { |
| 30 frame_->GetTextSuggestionController().DeleteActiveSuggestionRange(); |
| 31 } |
| 32 |
| 33 void TextSuggestionBackendImpl::NewWordAddedToDictionary( |
| 34 const WTF::String& word) { |
| 35 frame_->GetTextSuggestionController().NewWordAddedToDictionary(word); |
| 36 } |
| 37 |
| 38 void TextSuggestionBackendImpl::SpellCheckMenuTimeoutCallback() { |
| 39 frame_->GetTextSuggestionController().SpellCheckMenuTimeoutCallback(); |
| 40 } |
| 41 |
| 42 void TextSuggestionBackendImpl::SuggestionMenuClosed() { |
| 43 frame_->GetTextSuggestionController().SuggestionMenuClosed(); |
| 44 } |
| 45 |
| 46 } // namespace blink |
OLD | NEW |