Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / chrome / common / spellcheck_common.h
blob7254c8c81e18ca33c7c2841b4121fbf9634b4122
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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_SPELLCHECK_COMMON_H_
6 #define CHROME_COMMON_SPELLCHECK_COMMON_H_
8 #include <string>
9 #include <vector>
11 namespace base {
12 class FilePath;
15 namespace chrome {
16 namespace spellcheck_common {
18 // The number of hours that a session of feedback for spelling service lasts.
19 // After this number of hours passes, all feedback.
20 static const int kSessionHours = 6;
22 // The number of context words to keep on either side of a misspelling for
23 // spelling service feedback.
24 static const int kContextWordCount = 2;
26 // The number of seconds between sending feedback to spelling service.
27 static const int kFeedbackIntervalSeconds = 1800; // 30 minutes
29 // Max number of dictionary suggestions.
30 static const int kMaxSuggestions = 5;
32 static const int kMaxAutoCorrectWordSize = 8;
34 // Maximum number of words in the custom spellcheck dictionary that can be
35 // synced.
36 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS = 1300;
38 // Maximum number of bytes in a word that can be added to the custom spellcheck
39 // dictionary.
40 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES = 99;
42 base::FilePath GetVersionedFileName(const std::string& input_language,
43 const base::FilePath& dict_dir);
45 std::string GetCorrespondingSpellCheckLanguage(const std::string& language);
47 // Get SpellChecker supported languages.
48 void SpellCheckLanguages(std::vector<std::string>* languages);
50 // Gets the ISO codes for the language and country of this |locale|. The
51 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or
52 // "de". This method converts the UI locale to a full locale ID and converts the
53 // full locale ID to an ISO language code and an ISO3 country code.
54 void GetISOLanguageCountryCodeFromLocale(const std::string& locale,
55 std::string* language_code,
56 std::string* country_code);
58 // Returns true if multilingual spellchecker is enabled.
59 bool IsMultilingualSpellcheckEnabled();
61 } // namespace spellcheck_common
62 } // namespace chrome
64 #endif // CHROME_COMMON_SPELLCHECK_COMMON_H_