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/suggestion/TextSuggestionBackendImpl.h" |
| 6 |
| 7 #include "core/editing/suggestion/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(std::unique_ptr<TextSuggestionBackendImpl>( |
| 21 new TextSuggestionBackendImpl(*frame)), |
| 22 std::move(request)); |
| 23 } |
| 24 |
| 25 void TextSuggestionBackendImpl::ApplySpellCheckSuggestion( |
| 26 const WTF::String& suggestion) { |
| 27 frame_->GetTextSuggestionController().ApplySpellCheckSuggestion(suggestion); |
| 28 } |
| 29 |
| 30 void TextSuggestionBackendImpl::DeleteActiveSuggestionRange() { |
| 31 frame_->GetTextSuggestionController().DeleteActiveSuggestionRange(); |
| 32 } |
| 33 |
| 34 void TextSuggestionBackendImpl::NewWordAddedToDictionary( |
| 35 const WTF::String& word) { |
| 36 frame_->GetTextSuggestionController().NewWordAddedToDictionary(word); |
| 37 } |
| 38 |
| 39 void TextSuggestionBackendImpl::SpellCheckMenuTimeoutCallback() { |
| 40 frame_->GetTextSuggestionController().SpellCheckMenuTimeoutCallback(); |
| 41 } |
| 42 |
| 43 void TextSuggestionBackendImpl::SuggestionMenuClosed() { |
| 44 frame_->GetTextSuggestionController().SuggestionMenuClosed(); |
| 45 } |
| 46 |
| 47 } // namespace blink |
OLD | NEW |