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

Unified Diff: chrome/browser/translate/chrome_translate_client.cc

Issue 2697703004: Allow TranslateRanker to override decisions taken by heuristics. (Closed)
Patch Set: Make ShouldSuppressBubbleUI easier to read. Created 3 years, 8 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
« no previous file with comments | « no previous file | components/metrics/proto/translate_event.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
groby-ooo-7-16 2017/04/20 19:45:57 Woohoo! Thank you! (Long term, I wonder if this ne
+
ShowTranslateBubbleResult result = ShowBubble(step, error_type);
if (result != ShowTranslateBubbleResult::SUCCESS &&
step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE) {
« no previous file with comments | « no previous file | components/metrics/proto/translate_event.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698