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

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

Issue 15295004: Translate: enable against unknown languages with server side detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebase for dcommit) Created 7 years, 7 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 bfeba33ce41288fb1b9477662dbe66e829122b1a..579664db0d72582b21055062e9fe765835541cde 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -48,7 +48,7 @@ void TranslateInfoBarDelegate::Create(
// The original language can only be "unknown" for the "translating"
// infobar, which is the case when the user started a translation from the
// context menu.
- DCHECK_EQ(TRANSLATING, infobar_type);
+ DCHECK(infobar_type == TRANSLATING || infobar_type == AFTER_TRANSLATE);
DCHECK_EQ(chrome::kUnknownLanguageCode, original_language);
}
}
@@ -299,6 +299,20 @@ void TranslateInfoBarDelegate::GetAfterTranslateStrings(
strings->push_back(text.substr(offsets[1]));
}
+// static
+void TranslateInfoBarDelegate::GetAfterTranslateWithAutoStrings(
+ std::vector<string16>* strings) {
+ DCHECK(strings);
+
+ size_t offset;
+ string16 text =
+ l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE_WITH_AUTO,
+ string16(), &offset);
+
+ strings->push_back(text.substr(0, offset));
+ strings->push_back(text.substr(offset));
+}
+
TranslateInfoBarDelegate::TranslateInfoBarDelegate(
Type infobar_type,
TranslateErrors::Type error_type,
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.h ('k') | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698