Index: chrome/browser/translate/translate_prefs.h |
diff --git a/chrome/browser/translate/translate_prefs.h b/chrome/browser/translate/translate_prefs.h |
index 0adf370d6bcbfe635a16d7a5cdf08fc2181b7447..d46ea29b8a699882a5168149a2850c0f26ac1fc9 100644 |
--- a/chrome/browser/translate/translate_prefs.h |
+++ b/chrome/browser/translate/translate_prefs.h |
@@ -27,11 +27,11 @@ class TranslatePrefs { |
explicit TranslatePrefs(PrefService* user_prefs); |
- bool IsLanguageBlacklisted(const std::string& original_language); |
+ bool IsLanguageBlacklisted(const std::string& original_language) const; |
void BlacklistLanguage(const std::string& original_language); |
void RemoveLanguageFromBlacklist(const std::string& original_language); |
- bool IsSiteBlacklisted(const std::string& site); |
+ bool IsSiteBlacklisted(const std::string& site) const; |
void BlacklistSite(const std::string& site); |
void RemoveSiteFromBlacklist(const std::string& site); |
@@ -42,16 +42,24 @@ class TranslatePrefs { |
void RemoveLanguagePairFromWhitelist(const std::string& original_language, |
const std::string& target_language); |
+ // Will return true if at least one language has been blacklisted |
MAD
2013/02/12 20:42:42
missing '.' at end of sentence...
Miguel Garcia
2013/02/13 09:31:27
Done.
|
+ bool HasBlacklistedLanguages() const; |
+ void ClearBlacklistedLanguages(); |
+ |
+ // Will return true if at least one site has been blacklisted |
MAD
2013/02/12 20:42:42
missing '.' at end of sentence...
Miguel Garcia
2013/02/13 09:31:27
Done.
|
+ bool HasBlacklistedSites(); |
+ void ClearBlacklistedSites(); |
+ |
// These methods are used to track how many times the user has denied the |
// translation for a specific language. (So we can present a UI to black-list |
// that language if the user keeps denying translations). |
- int GetTranslationDeniedCount(const std::string& language); |
+ int GetTranslationDeniedCount(const std::string& language) const; |
void IncrementTranslationDeniedCount(const std::string& language); |
void ResetTranslationDeniedCount(const std::string& language); |
// These methods are used to track how many times the user has accepted the |
// translation for a specific language. (So we can present a UI to white-list |
- // that langueg if the user keeps accepting translations). |
+ // that language if the user keeps accepting translations). |
int GetTranslationAcceptedCount(const std::string& language); |
void IncrementTranslationAcceptedCount(const std::string& language); |
void ResetTranslationAcceptedCount(const std::string& language); |
@@ -65,20 +73,21 @@ class TranslatePrefs { |
private: |
static void MigrateTranslateWhitelists(PrefService* user_prefs); |
- bool IsValueBlacklisted(const char* pref_id, const std::string& value); |
+ bool IsValueBlacklisted(const char* pref_id, const std::string& value) const; |
void BlacklistValue(const char* pref_id, const std::string& value); |
void RemoveValueFromBlacklist(const char* pref_id, const std::string& value); |
- bool IsValueInList(const base::ListValue* list, const std::string& value); |
+ bool IsValueInList( |
+ const base::ListValue* list, const std::string& value) const; |
bool IsLanguageWhitelisted(const std::string& original_language, |
- std::string* target_language); |
- |
+ std::string* target_language) const; |
+ bool IsListEmpty(const char* pref_id) const; |
// Retrieves the dictionary mapping the number of times translation has been |
// denied for a language, creating it if necessary. |
base::DictionaryValue* GetTranslationDeniedCountDictionary(); |
// Retrieves the dictionary mapping the number of times translation has been |
// accepted for a language, creating it if necessary. |
- base::DictionaryValue* GetTranslationAcceptedCountDictionary(); |
+ base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; |
PrefService* prefs_; // Weak. |
}; |