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

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

Issue 2871783003: Automatically trigger Always-Translate in new translation infobar (Closed)
Patch Set: 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 90ebd30e6cdab9dd2cd0970c0614ea39a42af5ab..b9aa44ad6b1f24fc896f9a652c94f664742a0541 100644
--- a/chrome/browser/ui/android/infobars/translate_compact_infobar.h
+++ b/chrome/browser/ui/android/infobars/translate_compact_infobar.h
@@ -36,6 +36,9 @@ class TranslateCompactInfoBar
int option,
jboolean value);
+ // Check whether we should automatically trigger "Always Translate"
+ bool ShouldAutoAlwaysTranslate();
+
// ContentTranslateDriver::Observer implementation.
void OnPageTranslated(const std::string& original_lang,
const std::string& translated_lang,
@@ -52,6 +55,10 @@ 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;
+
DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar);
};

Powered by Google App Engine
This is Rietveld 408576698