| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 static const char kPrefTranslateBlockedLanguages[]; | 87 static const char kPrefTranslateBlockedLanguages[]; |
| 88 static const char kPrefTranslateLastDeniedTimeForLanguage[]; | 88 static const char kPrefTranslateLastDeniedTimeForLanguage[]; |
| 89 static const char kPrefTranslateTooOftenDeniedForLanguage[]; | 89 static const char kPrefTranslateTooOftenDeniedForLanguage[]; |
| 90 | 90 |
| 91 // |preferred_languages_pref| is only used on Chrome OS, other platforms must | 91 // |preferred_languages_pref| is only used on Chrome OS, other platforms must |
| 92 // pass NULL. | 92 // pass NULL. |
| 93 TranslatePrefs(PrefService* user_prefs, | 93 TranslatePrefs(PrefService* user_prefs, |
| 94 const char* accept_languages_pref, | 94 const char* accept_languages_pref, |
| 95 const char* preferred_languages_pref); | 95 const char* preferred_languages_pref); |
| 96 | 96 |
| 97 // Checks if the translate feature is enabled. |
| 98 bool IsEnabled() const; |
| 99 |
| 97 // Sets the country that the application is run in. Determined by the | 100 // Sets the country that the application is run in. Determined by the |
| 98 // VariationsService, can be left empty. Used by TranslateExperiment. | 101 // VariationsService, can be left empty. Used by TranslateExperiment. |
| 99 void SetCountry(const std::string& country); | 102 void SetCountry(const std::string& country); |
| 100 std::string GetCountry() const; | 103 std::string GetCountry() const; |
| 101 | 104 |
| 102 // Resets the blocked languages list, the sites blacklist, the languages | 105 // Resets the blocked languages list, the sites blacklist, the languages |
| 103 // whitelist, and the accepted/denied counts. | 106 // whitelist, and the accepted/denied counts. |
| 104 void ResetToDefaults(); | 107 void ResetToDefaults(); |
| 105 | 108 |
| 106 bool IsBlockedLanguage(const std::string& original_language) const; | 109 bool IsBlockedLanguage(const std::string& original_language) const; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 PrefService* prefs_; // Weak. | 223 PrefService* prefs_; // Weak. |
| 221 | 224 |
| 222 std::string country_; // The country the app runs in. | 225 std::string country_; // The country the app runs in. |
| 223 | 226 |
| 224 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); | 227 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); |
| 225 }; | 228 }; |
| 226 | 229 |
| 227 } // namespace translate | 230 } // namespace translate |
| 228 | 231 |
| 229 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ | 232 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ |
| OLD | NEW |