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

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: nits 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..3934c80f9becda27475fc4d42de5c480d5e4dc3b 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -211,7 +211,17 @@ void TranslateInfoBarDelegate::AlwaysTranslatePageLanguage() {
void TranslateInfoBarDelegate::NeverTranslatePageLanguage() {
std::string original_lang = original_language_code();
- DCHECK(!prefs_.IsBlockedLanguage(original_lang));
+
+ // Don't use DCHECK(...) to check if the language is listed in the blocked
Evan Stade 2013/09/12 22:53:41 this comment seems pretty long to explain why a th
hajimehoshi 2013/09/13 01:39:19 Ok, I'll write the explanation at the description
+ // language list here because the language might already be listed. For
+ // example:
+ // 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