summaryrefslogtreecommitdiffstats
path: root/components/translate
diff options
context:
space:
mode:
authordroger <droger@chromium.org>2015-03-03 04:11:42 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-03 12:12:39 +0000
commit07e7e93ef4715bb5e803cc0151b82987b20530c3 (patch)
tree07e4c4f2b4498e76822e8f877cecbdc0bf2bc88d /components/translate
parentf7302e6c7f955f11679ab844cfe3d326f47bb0dc (diff)
downloadchromium_src-07e7e93ef4715bb5e803cc0151b82987b20530c3.zip
chromium_src-07e7e93ef4715bb5e803cc0151b82987b20530c3.tar.gz
chromium_src-07e7e93ef4715bb5e803cc0151b82987b20530c3.tar.bz2
[iOS] Fix DCHECK in ShouldShowAlwaysTranslateShortcut()
This CL upstreams a small fork in ShouldShowAlwaysTranslateShortcut on iOS, which is caused by a different UX on this platform. Review URL: https://codereview.chromium.org/972123002 Cr-Commit-Position: refs/heads/master@{#318864}
Diffstat (limited to 'components/translate')
-rw-r--r--components/translate/core/browser/translate_infobar_delegate.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/translate/core/browser/translate_infobar_delegate.cc b/components/translate/core/browser/translate_infobar_delegate.cc
index 56bf4de..9552463 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);