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()); |
} |