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

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

Issue 2874393002: Automatically trigger Never-Translate in new translation infobar (Closed)
Patch Set: sync and merge Created 3 years, 7 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
« no previous file with comments | « components/translate/core/browser/translate_infobar_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f6008521dd3d7ef0304ace07617ef6ef483f1ccd..d4410a2e1c477862d9d1fd943323a3a9f928c911 100644
--- a/components/translate/core/browser/translate_infobar_delegate.cc
+++ b/components/translate/core/browser/translate_infobar_delegate.cc
@@ -45,11 +45,6 @@ const int kNeverTranslateMinCount = 2;
const int kAlwaysTranslateMinCount = 3;
const int kNeverTranslateMinCount = 3;
#endif
-
-// For Compact UI, if number of consecutive translations is equal to this
-// number, infobar will automatically trigger "Always Translate".
-const int kAcceptCountThreshold = 5;
-
} // namespace
const base::Feature kTranslateCompactUI{"TranslateCompactUI",
@@ -302,10 +297,12 @@ void TranslateInfoBarDelegate::ShowNeverTranslateInfobar() {
}
#endif
-bool TranslateInfoBarDelegate::ShouldAutoAlwaysTranslate() {
- return (IsCompactUIEnabled() &&
- prefs_->GetTranslationAcceptedCount(original_language_code()) ==
- kAcceptCountThreshold);
+int TranslateInfoBarDelegate::GetTranslationAcceptedCount() {
+ return prefs_->GetTranslationAcceptedCount(original_language_code());
+}
+
+int TranslateInfoBarDelegate::GetTranslationDeniedCount() {
+ return prefs_->GetTranslationDeniedCount(original_language_code());
}
// static
« no previous file with comments | « components/translate/core/browser/translate_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698