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

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

Issue 23923007: Bug fix: Append a language to the list after blocking it for Translate on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 7 years, 3 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/translate/translate_infobar_delegate.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 9cabbaa637fe8771b12e76e185e546d1f4d2cb27..2a55bb7e8dfa0143a9ab4cd550e07b4374bdcfd4 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -211,7 +211,15 @@ void TranslateInfoBarDelegate::AlwaysTranslatePageLanguage() {
void TranslateInfoBarDelegate::NeverTranslatePageLanguage() {
std::string original_lang = original_language_code();
- DCHECK(!prefs_.IsBlockedLanguage(original_lang));
+
+ // The language might already be in the blocked list. For example:
Takashi Toyoshima 2013/09/10 05:51:54 This comment shows the reason why you want to remo
hajimehoshi 2013/09/10 06:11:33 Done.
+ // 1. After the user add the language, he/she removes the language from
+ // chrome://settings/languages. In this case, Translate infobar will
+ // appear.
+ // 2. While the Translate infobar is shown, the user can change if Translate
+ // should be offered in the language. In this case, the user can push
+ // "Never Translate (language)" button while the language is already
+ // blocked.
prefs_.BlockLanguage(original_lang);
RemoveSelf();
}

Powered by Google App Engine
This is Rietveld 408576698