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

Unified Diff: chrome/browser/ui/android/infobars/translate_compact_infobar.h

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
Index: chrome/browser/ui/android/infobars/translate_compact_infobar.h
diff --git a/chrome/browser/ui/android/infobars/translate_compact_infobar.h b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
index d186030bc016d2c4f19bf54925ad98ecb30022a3..aeabb616fe27b7a9b09335e18414955f6212d4bf 100644
--- a/chrome/browser/ui/android/infobars/translate_compact_infobar.h
+++ b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
@@ -39,6 +39,11 @@ class TranslateCompactInfoBar
// Check whether we should automatically trigger "Always Translate".
bool ShouldAutoAlwaysTranslate();
+ // Check whether we should automatically trigger "Never Translate Language".
+ jboolean ShouldAutoNeverTranslate(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
// ContentTranslateDriver::Observer implementation.
void OnPageTranslated(const std::string& original_lang,
const std::string& translated_lang,
@@ -55,6 +60,13 @@ class TranslateCompactInfoBar
translate::TranslateInfoBarDelegate* GetDelegate();
translate::ContentTranslateDriver* translate_driver_;
+ // If number of consecutive translations is equal to this number, infobar will
+ // automatically trigger "Always Translate".
+ const int kAcceptCountThreshold = 5;
+ // If number of consecutive denied is equal to this number, infobar will
+ // automatically trigger "Never Translate Language".
+ const int kDeniedCountThreshold = 7;
+
DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar);
};

Powered by Google App Engine
This is Rietveld 408576698