| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ | 5 #ifndef COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ |
| 6 #define COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ | 6 #define COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace spellcheck { | 17 namespace spellcheck { |
| 18 | 18 |
| 19 // The number of hours that a session of feedback for spelling service lasts. | |
| 20 // After this number of hours passes, all feedback. | |
| 21 static const int kSessionHours = 6; | |
| 22 | |
| 23 // The number of context words to keep on either side of a misspelling for | |
| 24 // spelling service feedback. | |
| 25 static const int kContextWordCount = 2; | |
| 26 | |
| 27 // The number of seconds between sending feedback to spelling service. | |
| 28 static const int kFeedbackIntervalSeconds = 1800; // 30 minutes | |
| 29 | |
| 30 // Max number of dictionary suggestions. | 19 // Max number of dictionary suggestions. |
| 31 static const int kMaxSuggestions = 5; | 20 static const int kMaxSuggestions = 5; |
| 32 | 21 |
| 33 // Maximum number of words in the custom spellcheck dictionary that can be | 22 // Maximum number of words in the custom spellcheck dictionary that can be |
| 34 // synced. | 23 // synced. |
| 35 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS = 1300; | 24 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS = 1300; |
| 36 | 25 |
| 37 // Maximum number of bytes in a word that can be added to the custom spellcheck | 26 // Maximum number of bytes in a word that can be added to the custom spellcheck |
| 38 // dictionary. | 27 // dictionary. |
| 39 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES = 99; | 28 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES = 99; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 58 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or | 47 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or |
| 59 // "de". This method converts the UI locale to a full locale ID and converts the | 48 // "de". This method converts the UI locale to a full locale ID and converts the |
| 60 // full locale ID to an ISO language code and an ISO3 country code. | 49 // full locale ID to an ISO language code and an ISO3 country code. |
| 61 void GetISOLanguageCountryCodeFromLocale(const std::string& locale, | 50 void GetISOLanguageCountryCodeFromLocale(const std::string& locale, |
| 62 std::string* language_code, | 51 std::string* language_code, |
| 63 std::string* country_code); | 52 std::string* country_code); |
| 64 | 53 |
| 65 } // namespace spellcheck | 54 } // namespace spellcheck |
| 66 | 55 |
| 67 #endif // COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ | 56 #endif // COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_COMMON_H_ |
| OLD | NEW |