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

Unified Diff: content/browser/android/text_suggestion_host_mojo_impl_android.cc

Issue 2931443003: Add support for Android spellcheck menu in Chrome/WebViews (Closed)
Patch Set: Remove leftover traces 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: content/browser/android/text_suggestion_host_mojo_impl_android.cc
diff --git a/content/browser/android/text_suggestion_host_mojo_impl_android.cc b/content/browser/android/text_suggestion_host_mojo_impl_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..52342f682c9966bf868694693e6486074566b0ef
--- /dev/null
+++ b/content/browser/android/text_suggestion_host_mojo_impl_android.cc
@@ -0,0 +1,39 @@
+// 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 "content/browser/android/text_suggestion_host_mojo_impl_android.h"
+
+#include "content/browser/android/text_suggestion_host_android.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace content {
+
+TextSuggestionHostMojoImplAndroid::TextSuggestionHostMojoImplAndroid(
+ TextSuggestionHostAndroid* text_suggestion_host)
+ : text_suggestion_host_(text_suggestion_host) {}
+
+// static
+void TextSuggestionHostMojoImplAndroid::Create(
+ TextSuggestionHostAndroid* text_suggestion_host,
+ const service_manager::BindSourceInfo& source_info,
+ blink::mojom::TextSuggestionHostRequest request) {
+ mojo::MakeStrongBinding(
+ base::MakeUnique<TextSuggestionHostMojoImplAndroid>(text_suggestion_host),
+ std::move(request));
+}
+
+void TextSuggestionHostMojoImplAndroid::StartSpellCheckMenuTimer() {
+ text_suggestion_host_->StartSpellCheckMenuTimer();
+}
+
+void TextSuggestionHostMojoImplAndroid::ShowSpellCheckSuggestionMenu(
+ double caret_x,
+ double caret_y,
+ const std::string& marked_text,
+ std::vector<blink::mojom::SpellCheckSuggestionPtr> suggestions) {
+ text_suggestion_host_->ShowSpellCheckSuggestionMenu(caret_x, caret_y,
+ marked_text, suggestions);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698