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

Unified Diff: components/translate/core/browser/translate_infobar_delegate.cc

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_infobar_delegate.cc
diff --git a/components/translate/core/browser/translate_infobar_delegate.cc b/components/translate/core/browser/translate_infobar_delegate.cc
index b00e724212fc9bbedd440552003db78a88439c61..cb32c684ddd1bc393344f6b502f3b3e7c22abfd9 100644
--- a/components/translate/core/browser/translate_infobar_delegate.cc
+++ b/components/translate/core/browser/translate_infobar_delegate.cc
@@ -310,6 +310,32 @@ int TranslateInfoBarDelegate::GetTranslationDeniedCount() {
return prefs_->GetTranslationDeniedCount(original_language_code());
}
+void TranslateInfoBarDelegate::ResetTranslationAcceptedCount() {
+ prefs_->ResetTranslationAcceptedCount(original_language_code());
+}
+
+void TranslateInfoBarDelegate::ResetTranslationDeniedCount() {
+ prefs_->ResetTranslationDeniedCount(original_language_code());
+}
+
+#if defined(OS_ANDROID)
+int TranslateInfoBarDelegate::GetTranslationAutoAlwaysCount() {
+ return prefs_->GetTranslationAutoAlwaysCount(original_language_code());
+}
+
+int TranslateInfoBarDelegate::GetTranslationAutoNeverCount() {
+ return prefs_->GetTranslationAutoNeverCount(original_language_code());
+}
+
+void TranslateInfoBarDelegate::IncrementTranslationAutoAlwaysCount() {
+ prefs_->IncrementTranslationAutoAlwaysCount(original_language_code());
+}
+
+void TranslateInfoBarDelegate::IncrementTranslationAutoNeverCount() {
+ prefs_->IncrementTranslationAutoNeverCount(original_language_code());
+}
+#endif
+
// static
void TranslateInfoBarDelegate::GetAfterTranslateStrings(
std::vector<base::string16>* strings,
« no previous file with comments | « components/translate/core/browser/translate_infobar_delegate.h ('k') | components/translate/core/browser/translate_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698