| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace user_prefs { | 29 namespace user_prefs { |
| 30 class PrefRegistrySyncable; | 30 class PrefRegistrySyncable; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace translate { | 33 namespace translate { |
| 34 | 34 |
| 35 // Feature flag for "Translate UI 2016 Q2" project. | 35 // Feature flag for "Translate UI 2016 Q2" project. |
| 36 extern const base::Feature kTranslateUI2016Q2; | 36 extern const base::Feature kTranslateUI2016Q2; |
| 37 | 37 |
| 38 // The trial (study) name in finch study config. |
| 39 extern const char kTranslateUI2016Q2TrialName[]; |
| 40 |
| 41 // The name of the parameter for the number of translations, after which the |
| 42 // "Always Translate" checkbox default to checked. |
| 43 extern const char kAlwaysTranslateOfferThreshold[]; |
| 44 |
| 38 class TranslateAcceptLanguages; | 45 class TranslateAcceptLanguages; |
| 39 | 46 |
| 40 // Allows updating denial times for a specific language while maintaining the | 47 // Allows updating denial times for a specific language while maintaining the |
| 41 // maximum list size and ensuring PrefObservers are notified of change values. | 48 // maximum list size and ensuring PrefObservers are notified of change values. |
| 42 class DenialTimeUpdate { | 49 class DenialTimeUpdate { |
| 43 public: | 50 public: |
| 44 DenialTimeUpdate(PrefService* prefs, | 51 DenialTimeUpdate(PrefService* prefs, |
| 45 const std::string& language, | 52 const std::string& language, |
| 46 size_t max_denial_count); | 53 size_t max_denial_count); |
| 47 ~DenialTimeUpdate(); | 54 ~DenialTimeUpdate(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Gets the language list of the language settings. | 157 // Gets the language list of the language settings. |
| 151 void GetLanguageList(std::vector<std::string>* languages) const; | 158 void GetLanguageList(std::vector<std::string>* languages) const; |
| 152 | 159 |
| 153 // Updates the language list of the language settings. | 160 // Updates the language list of the language settings. |
| 154 void UpdateLanguageList(const std::vector<std::string>& languages); | 161 void UpdateLanguageList(const std::vector<std::string>& languages); |
| 155 | 162 |
| 156 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, | 163 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, |
| 157 const std::string& language); | 164 const std::string& language); |
| 158 bool ShouldAutoTranslate(const std::string& original_language, | 165 bool ShouldAutoTranslate(const std::string& original_language, |
| 159 std::string* target_language); | 166 std::string* target_language); |
| 167 |
| 160 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 168 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 161 static void MigrateUserPrefs(PrefService* user_prefs, | 169 static void MigrateUserPrefs(PrefService* user_prefs, |
| 162 const char* accept_languages_pref); | 170 const char* accept_languages_pref); |
| 163 | 171 |
| 164 private: | 172 private: |
| 165 friend class TranslatePrefsTest; | 173 friend class TranslatePrefsTest; |
| 166 | 174 |
| 167 // Merges two language sets to migrate to the language setting UI. | 175 // Merges two language sets to migrate to the language setting UI. |
| 168 static void CreateBlockedLanguages( | 176 static void CreateBlockedLanguages( |
| 169 std::vector<std::string>* blocked_languages, | 177 std::vector<std::string>* blocked_languages, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 200 PrefService* prefs_; // Weak. | 208 PrefService* prefs_; // Weak. |
| 201 | 209 |
| 202 std::string country_; // The country the app runs in. | 210 std::string country_; // The country the app runs in. |
| 203 | 211 |
| 204 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); | 212 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); |
| 205 }; | 213 }; |
| 206 | 214 |
| 207 } // namespace translate | 215 } // namespace translate |
| 208 | 216 |
| 209 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ | 217 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ |
| OLD | NEW |