| 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 CHROME_COMMON_SPELLCHECK_COMMON_H_ | 5 #ifndef CHROME_COMMON_SPELLCHECK_COMMON_H_ |
| 6 #define CHROME_COMMON_SPELLCHECK_COMMON_H_ | 6 #define CHROME_COMMON_SPELLCHECK_COMMON_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 static const int kMaxAutoCorrectWordSize = 8; | 33 static const int kMaxAutoCorrectWordSize = 8; |
| 34 | 34 |
| 35 // Maximum number of words in the custom spellcheck dictionary that can be | 35 // Maximum number of words in the custom spellcheck dictionary that can be |
| 36 // synced. | 36 // synced. |
| 37 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS = 1300; | 37 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS = 1300; |
| 38 | 38 |
| 39 // Maximum number of bytes in a word that can be added to the custom spellcheck | 39 // Maximum number of bytes in a word that can be added to the custom spellcheck |
| 40 // dictionary. | 40 // dictionary. |
| 41 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES = 99; | 41 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES = 99; |
| 42 | 42 |
| 43 // Character that separates language codes saved in preferences. |
| 44 static const char kDictionaryLanguagesSeparator = ','; |
| 45 |
| 43 typedef std::vector<std::string> WordList; | 46 typedef std::vector<std::string> WordList; |
| 44 typedef std::set<std::string> WordSet; | 47 typedef std::set<std::string> WordSet; |
| 45 | 48 |
| 46 base::FilePath GetVersionedFileName(const std::string& input_language, | 49 base::FilePath GetVersionedFileName(const std::string& input_language, |
| 47 const base::FilePath& dict_dir); | 50 const base::FilePath& dict_dir); |
| 48 | 51 |
| 49 std::string GetCorrespondingSpellCheckLanguage(const std::string& language); | 52 std::string GetCorrespondingSpellCheckLanguage(const std::string& language); |
| 50 | 53 |
| 51 // Get SpellChecker supported languages. | 54 // Get SpellChecker supported languages. |
| 52 void SpellCheckLanguages(std::vector<std::string>* languages); | 55 void SpellCheckLanguages(std::vector<std::string>* languages); |
| 53 | 56 |
| 54 // Gets the ISO codes for the language and country of this |locale|. The | 57 // Gets the ISO codes for the language and country of this |locale|. The |
| 55 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or | 58 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or |
| 56 // "de". This method converts the UI locale to a full locale ID and converts the | 59 // "de". This method converts the UI locale to a full locale ID and converts the |
| 57 // full locale ID to an ISO language code and an ISO3 country code. | 60 // full locale ID to an ISO language code and an ISO3 country code. |
| 58 void GetISOLanguageCountryCodeFromLocale(const std::string& locale, | 61 void GetISOLanguageCountryCodeFromLocale(const std::string& locale, |
| 59 std::string* language_code, | 62 std::string* language_code, |
| 60 std::string* country_code); | 63 std::string* country_code); |
| 61 | 64 |
| 62 } // namespace spellcheck_common | 65 } // namespace spellcheck_common |
| 63 } // namespace chrome | 66 } // namespace chrome |
| 64 | 67 |
| 65 #endif // CHROME_COMMON_SPELLCHECK_COMMON_H_ | 68 #endif // CHROME_COMMON_SPELLCHECK_COMMON_H_ |
| OLD | NEW |