| Index: chrome/browser/translate/chrome_translate_client.cc
|
| diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
|
| index 37e559760981b6aa4632cf4a56f668a8e5176166..52a442a7b9ce6a3e6e5949fd98a5f034cc19c873 100644
|
| --- a/chrome/browser/translate/chrome_translate_client.cc
|
| +++ b/chrome/browser/translate/chrome_translate_client.cc
|
| @@ -220,25 +220,12 @@ void ChromeTranslateClient::ShowTranslateUI(
|
| #endif
|
|
|
| // Bubble UI.
|
| - if (step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE) {
|
| - // TODO(droger): Move this logic out of UI code.
|
| - GetLanguageState().SetTranslateEnabled(true);
|
| - // In the new UI, continue offering translation after the user navigates to
|
| - // another page.
|
| - if (!base::FeatureList::IsEnabled(translate::kTranslateUI2016Q2) &&
|
| - !GetLanguageState().HasLanguageChanged()) {
|
| - translate_manager_->RecordTranslateEvent(
|
| - metrics::TranslateEventProto::MATCHES_PREVIOUS_LANGUAGE);
|
| - return;
|
| - }
|
| -
|
| - if (!triggered_from_menu &&
|
| - GetTranslatePrefs()->IsTooOftenDenied(source_language)) {
|
| - translate_manager_->RecordTranslateEvent(
|
| - metrics::TranslateEventProto::LANGUAGE_DISABLED_BY_AUTO_BLACKLIST);
|
| - return;
|
| - }
|
| + if (step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE &&
|
| + translate_manager_->ShouldSuppressBubbleUI(triggered_from_menu,
|
| + source_language)) {
|
| + return;
|
| }
|
| +
|
| ShowTranslateBubbleResult result = ShowBubble(step, error_type);
|
| if (result != ShowTranslateBubbleResult::SUCCESS &&
|
| step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE) {
|
|
|