OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // translation for a specific language. (So we can present a UI to white-list | 76 // translation for a specific language. (So we can present a UI to white-list |
77 // that language if the user keeps accepting translations). | 77 // that language if the user keeps accepting translations). |
78 int GetTranslationAcceptedCount(const std::string& language); | 78 int GetTranslationAcceptedCount(const std::string& language); |
79 void IncrementTranslationAcceptedCount(const std::string& language); | 79 void IncrementTranslationAcceptedCount(const std::string& language); |
80 void ResetTranslationAcceptedCount(const std::string& language); | 80 void ResetTranslationAcceptedCount(const std::string& language); |
81 | 81 |
82 static bool CanTranslateLanguage( | 82 static bool CanTranslateLanguage( |
83 Profile* profile, const std::string& language); | 83 Profile* profile, const std::string& language); |
84 static bool ShouldAutoTranslate(PrefService* user_prefs, | 84 static bool ShouldAutoTranslate(PrefService* user_prefs, |
85 const std::string& original_language, std::string* target_language); | 85 const std::string& original_language, std::string* target_language); |
86 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 86 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
87 static void MigrateUserPrefs(PrefService* user_prefs); | 87 static void MigrateUserPrefs(PrefService* user_prefs); |
88 | 88 |
89 private: | 89 private: |
90 friend class TranslatePrefsTest; | 90 friend class TranslatePrefsTest; |
91 FRIEND_TEST_ALL_PREFIXES(TranslatePrefsTest, CreateBlockedLanguages); | 91 FRIEND_TEST_ALL_PREFIXES(TranslatePrefsTest, CreateBlockedLanguages); |
92 | 92 |
93 // Merges two language sets to migrate to the language setting UI. | 93 // Merges two language sets to migrate to the language setting UI. |
94 static void CreateBlockedLanguages( | 94 static void CreateBlockedLanguages( |
95 std::vector<std::string>* blocked_languages, | 95 std::vector<std::string>* blocked_languages, |
96 const std::vector<std::string>& blacklisted_languages, | 96 const std::vector<std::string>& blacklisted_languages, |
(...skipping 14 matching lines...) Expand all Loading... |
111 base::DictionaryValue* GetTranslationDeniedCountDictionary(); | 111 base::DictionaryValue* GetTranslationDeniedCountDictionary(); |
112 | 112 |
113 // Retrieves the dictionary mapping the number of times translation has been | 113 // Retrieves the dictionary mapping the number of times translation has been |
114 // accepted for a language, creating it if necessary. | 114 // accepted for a language, creating it if necessary. |
115 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; | 115 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; |
116 | 116 |
117 PrefService* prefs_; // Weak. | 117 PrefService* prefs_; // Weak. |
118 }; | 118 }; |
119 | 119 |
120 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ | 120 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_PREFS_H_ |
OLD | NEW |