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

Unified Diff: services/prediction/proximity_info_factory.h

Issue 1247903003: Add spellcheck and word suggestion to the prediction service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: format README and CHROMIUM.diff Created 5 years, 4 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
« no previous file with comments | « services/prediction/prediction_service_impl.cc ('k') | services/prediction/proximity_info_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/prediction/proximity_info_factory.h
diff --git a/services/prediction/proximity_info_factory.h b/services/prediction/proximity_info_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ac8186eb82145aeae324e350990bc27808f45ce
--- /dev/null
+++ b/services/prediction/proximity_info_factory.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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.
+
+#ifndef SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_
+#define SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_
+
+#include "mojo/services/prediction/public/interfaces/prediction.mojom.h"
+#include "services/prediction/key_set.h"
+#include "third_party/android_prediction/suggest/core/layout/proximity_info.h"
+
+// NOTE: This class has been translated to C++ and modified from the Android
+// Open Source Project. Specifically from some functions of the following file:
+// https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/
+// android-5.1.1_r8/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
+
+namespace prediction {
+
+class ProximityInfoFactory {
+ public:
+ ProximityInfoFactory();
+ ~ProximityInfoFactory();
+
+ latinime::ProximityInfo* GetNativeProximityInfo();
+
+ private:
+ // Number of key widths from current touch point to search for nearest keys.
+ static const float SEARCH_DISTANCE;
+ static const float DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS;
+
+ int SquaredDistanceToEdge(int x, int y, Key k);
+
+ int pgrid_width_;
+ int pgrid_height_;
+ int pgrid_size_;
+ int pcell_width_;
+ int pcell_height_;
+ int pkeyboard_min_width_;
+ int pkeyboard_height_;
+ int pmost_common_key_width_;
+ int pmost_common_key_height_;
+ std::string plocale_;
+}; // class ProximityInfoFactory
+
+} // namespace prediction
+
+#endif // SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_
« no previous file with comments | « services/prediction/prediction_service_impl.cc ('k') | services/prediction/proximity_info_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698