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

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

Issue 345743002: Translate: Hide the bubble if the user denies translating 2 times within 24 hours (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed prefs names Created 6 years, 6 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/translate/core/browser/translate_prefs.h » ('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 6abb359d7edd93c53952364d8831645d74d70560..50e98fbd574b113475162135fa67370bf3876847 100644
--- a/chrome/browser/translate/chrome_translate_client.cc
+++ b/chrome/browser/translate/chrome_translate_client.cc
@@ -175,6 +175,13 @@ void ChromeTranslateClient::ShowTranslateUI(translate::TranslateStep step,
GetLanguageState().SetTranslateEnabled(true);
if (!GetLanguageState().HasLanguageChanged())
return;
+
+ if (!triggered_from_menu) {
+ if (web_contents()->GetBrowserContext()->IsOffTheRecord())
+ return;
+ if (GetTranslatePrefs()->IsTooOftenDenied())
+ return;
+ }
}
ShowBubble(step, error_type);
return;
« no previous file with comments | « no previous file | components/translate/core/browser/translate_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698