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

Unified Diff: components/translate/core/browser/translate_infobar_delegate.cc

Issue 972123002: [iOS] Fix DCHECK in ShouldShowAlwaysTranslateShortcut() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/core/browser/translate_infobar_delegate.cc
diff --git a/components/translate/core/browser/translate_infobar_delegate.cc b/components/translate/core/browser/translate_infobar_delegate.cc
index 56bf4de83ad681b09b2a649b4e12dfc4021954a3..9552463677d2c9a36002ebd742672592d0943ed9 100644
--- a/components/translate/core/browser/translate_infobar_delegate.cc
+++ b/components/translate/core/browser/translate_infobar_delegate.cc
@@ -262,7 +262,13 @@ bool TranslateInfoBarDelegate::ShouldShowNeverTranslateShortcut() {
}
bool TranslateInfoBarDelegate::ShouldShowAlwaysTranslateShortcut() {
+#if defined(OS_IOS)
+ // On mobile, the option to always translate is shown after the translation.
+ DCHECK_EQ(translate::TRANSLATE_STEP_AFTER_TRANSLATE, step_);
+#else
+ // On desktop, the option to always translate is shown before the translation.
DCHECK_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE, step_);
+#endif
return !is_off_the_record_ &&
(prefs_->GetTranslationAcceptedCount(original_language_code()) >=
kAlwaysTranslateMinCount);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698