OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #ifndef SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_ |
| 6 #define SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_ |
| 7 |
| 8 #include "mojo/services/prediction/public/interfaces/prediction.mojom.h" |
| 9 #include "services/prediction/key_set.h" |
| 10 #include "third_party/android_prediction/suggest/core/layout/proximity_info.h" |
| 11 |
| 12 // NOTE: This class has been translated to C++ and modified from the Android |
| 13 // Open Source Project. Specifically from some functions of the following file: |
| 14 // https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/ |
| 15 // android-5.1.1_r8/java/src/com/android/inputmethod/keyboard/ProximityInfo.java |
| 16 |
| 17 namespace prediction { |
| 18 |
| 19 class ProximityInfoFactory { |
| 20 public: |
| 21 ProximityInfoFactory(); |
| 22 ~ProximityInfoFactory(); |
| 23 |
| 24 latinime::ProximityInfo* GetNativeProximityInfo(); |
| 25 |
| 26 private: |
| 27 // Number of key widths from current touch point to search for nearest keys. |
| 28 static const float SEARCH_DISTANCE; |
| 29 static const float DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS; |
| 30 |
| 31 int SquaredDistanceToEdge(int x, int y, Key k); |
| 32 |
| 33 int pgrid_width_; |
| 34 int pgrid_height_; |
| 35 int pgrid_size_; |
| 36 int pcell_width_; |
| 37 int pcell_height_; |
| 38 int pkeyboard_min_width_; |
| 39 int pkeyboard_height_; |
| 40 int pmost_common_key_width_; |
| 41 int pmost_common_key_height_; |
| 42 std::string plocale_; |
| 43 }; // class ProximityInfoFactory |
| 44 |
| 45 } // namespace prediction |
| 46 |
| 47 #endif // SERVICES_PREDICTION_PROXIMITY_INFO_FACTORY_H_ |
OLD | NEW |