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

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

Issue 2090283002: add experimental param to control the triggering threshold to default Always Translate checked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test breakage Created 4 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_ui_delegate.cc
diff --git a/components/translate/core/browser/translate_ui_delegate.cc b/components/translate/core/browser/translate_ui_delegate.cc
index 50879397171f0a66a0c9c50180aea59e27d7a43e..d9e2b511b6625875ab7e64d7a292d4fb3c1a60e0 100644
--- a/components/translate/core/browser/translate_ui_delegate.cc
+++ b/components/translate/core/browser/translate_ui_delegate.cc
@@ -302,14 +302,15 @@ bool TranslateUIDelegate::ShouldAlwaysTranslate() {
}
bool TranslateUIDelegate::ShouldAlwaysTranslateBeCheckedByDefault() {
- // After 2 clicks on Translate for the same language.
- // We check for == 2 instead of >= 2 because if the user translates with the
+ // After N clicks on Translate for the same language.
+ // We check for == N instead of >= N because if the user translates with the
// "Always do this?" on, then the next time the bubble won't show up.
// The only chance the bubble will show up is after the user manually unchecks
// "Always do this?". In that case, since it is after user explictly unchecks,
- // we should show as it as unchecked so we only check == 2 instead of >= 2.
+ // we should show as it as unchecked so we only check == N instead of >= N.
return ShouldAlwaysTranslate() ||
- prefs_->GetTranslationAcceptedCount(GetOriginalLanguageCode()) == 2;
+ prefs_->ShouldAlwaysTranslateBeCheckedByDefault(
+ GetOriginalLanguageCode());
}
void TranslateUIDelegate::SetAlwaysTranslate(bool value) {

Powered by Google App Engine
This is Rietveld 408576698