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

Unified Diff: services/prediction/prediction_service_impl.cc

Issue 1247903003: Add spellcheck and word suggestion to the prediction service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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: services/prediction/prediction_service_impl.cc
diff --git a/services/prediction/prediction_service_impl.cc b/services/prediction/prediction_service_impl.cc
index cd3079ac18b9f3017c64991272e080084b597795..ccc1596f2d274dc868fcf7d201874e3551adf952 100644
--- a/services/prediction/prediction_service_impl.cc
+++ b/services/prediction/prediction_service_impl.cc
@@ -7,6 +7,7 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/prediction/dictionary_service.h"
#include "services/prediction/prediction_service_impl.h"
namespace prediction {
@@ -14,28 +15,21 @@ namespace prediction {
PredictionServiceImpl::PredictionServiceImpl(
mojo::InterfaceRequest<PredictionService> request)
: strong_binding_(this, request.Pass()) {
+ ProximityInfoFactory proximity_info;
+ proximity_settings_ = scoped_ptr<latinime::ProximityInfo>(
+ proximity_info.GetNativeProximityInfo());
}
PredictionServiceImpl::~PredictionServiceImpl() {
}
// PredictionService implementation
-void PredictionServiceImpl::SetSettings(SettingsPtr settings) {
- stored_settings_.correction_enabled = settings->correction_enabled;
- stored_settings_.block_potentially_offensive =
- settings->block_potentially_offensive;
- stored_settings_.space_aware_gesture_enabled =
- settings->space_aware_gesture_enabled;
-}
-
-// only predict "cat" no matter what prediction_info
-// has for now
void PredictionServiceImpl::GetPredictionList(
PredictionInfoPtr prediction_info,
const GetPredictionListCallback& callback) {
- mojo::String cat = "cat";
- mojo::Array<mojo::String> prediction_list;
- prediction_list.push_back(cat);
+ mojo::Array<mojo::String> prediction_list =
+ dictionary_service_.GetDictionarySuggestion(prediction_info.Pass(),
+ proximity_settings_.get());
callback.Run(prediction_list.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698