Chromium Code Reviews| 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..b530c6661f58926b7c8103bd4f182fd928df85d6 100644 |
| --- a/components/translate/core/browser/translate_infobar_delegate.cc |
| +++ b/components/translate/core/browser/translate_infobar_delegate.cc |
| @@ -49,6 +49,9 @@ const int kNeverTranslateMinCount = 3; |
| // For Compact UI, if number of consecutive translations is equal to this |
| // number, infobar will automatically trigger "Always Translate". |
| const int kAcceptCountThreshold = 5; |
| +// For Compact UI, if number of consecutive denied is equal to this |
| +// number, infobar will automatically trigger "Never Translate Language". |
| +const int kDeniedCountThreshold = 7; |
| } // namespace |
| @@ -308,6 +311,12 @@ bool TranslateInfoBarDelegate::ShouldAutoAlwaysTranslate() { |
| kAcceptCountThreshold); |
| } |
| +bool TranslateInfoBarDelegate::ShouldAutoNeverTranslate() { |
|
Leo
2017/05/12 05:09:07
Can we move all the CompactUIEnabled logic to ui/a
Marti Wong
2017/05/12 07:16:11
Done.
|
| + return (IsCompactUIEnabled() && |
| + prefs_->GetTranslationDeniedCount(original_language_code()) == |
| + kDeniedCountThreshold); |
| +} |
| + |
| // static |
| void TranslateInfoBarDelegate::GetAfterTranslateStrings( |
| std::vector<base::string16>* strings, |