Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: components/translate/core/browser/translate_prefs.h

Issue 2920953002: Auto-always/never can at most triggered twice (new translate infobar) (Closed)
Patch Set: fix Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/browser/translate_prefs.h
diff --git a/components/translate/core/browser/translate_prefs.h b/components/translate/core/browser/translate_prefs.h
index 61a35d83a83cb4f59b4bfcd6fb3defc5a5a3e41e..95824256c836f414d5e9474375b90e6cfe5d5db0 100644
--- a/components/translate/core/browser/translate_prefs.h
+++ b/components/translate/core/browser/translate_prefs.h
@@ -87,6 +87,10 @@ class TranslatePrefs {
static const char kPrefTranslateBlockedLanguages[];
static const char kPrefTranslateLastDeniedTimeForLanguage[];
static const char kPrefTranslateTooOftenDeniedForLanguage[];
+#if defined(OS_ANDROID)
+ static const char kPrefTranslateAutoAlwaysCount[];
+ static const char kPrefTranslateAutoNeverCount[];
+#endif
// |preferred_languages_pref| is only used on Chrome OS, other platforms must
// pass NULL.
@@ -149,6 +153,20 @@ class TranslatePrefs {
void IncrementTranslationAcceptedCount(const std::string& language);
void ResetTranslationAcceptedCount(const std::string& language);
+#if defined(OS_ANDROID)
+ // These methods are used to track how many times the auto-always translation
+ // has been triggered for a specific language.
+ int GetTranslationAutoAlwaysCount(const std::string& language) const;
+ void IncrementTranslationAutoAlwaysCount(const std::string& language);
+ void ResetTranslationAutoAlwaysCount(const std::string& language);
+
+ // These methods are used to track how many times the auto-never translation
+ // has been triggered for a specific language.
+ int GetTranslationAutoNeverCount(const std::string& language) const;
+ void IncrementTranslationAutoNeverCount(const std::string& language);
+ void ResetTranslationAutoNeverCount(const std::string& language);
+#endif
+
// Update the last time on closing the Translate UI without translation.
void UpdateLastDeniedTime(const std::string& language);
« no previous file with comments | « components/translate/core/browser/translate_infobar_delegate.cc ('k') | components/translate/core/browser/translate_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698