Index: chrome/browser/translate/translate_infobar_delegate.h |
diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h |
index 44fae4b72b86a047c2917e25ad1c9b91b0daf021..b0613eaed019e7b2ba189006ec5c63cad3f267a3 100644 |
--- a/chrome/browser/translate/translate_infobar_delegate.h |
+++ b/chrome/browser/translate/translate_infobar_delegate.h |
@@ -79,6 +79,8 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { |
// Returns the displayable name for the language at |index|. |
string16 language_name_at(size_t index) const { |
+ if (index == kNoIndex) |
+ return string16(); |
DCHECK_LT(index, num_languages()); |
return languages_[index].second; |
} |
@@ -175,6 +177,15 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { |
static void GetAfterTranslateStrings(std::vector<string16>* strings, |
bool* swap_languages); |
+ // Adds the strings that should be displayed in the after translate infobar to |
+ // |strings|. When a source language is not determined by Chrome, Languages |
+ // are detected by a server automatically. And infobar doesn't show source |
+ // languages. The text in the infobar is: |
+ // "The page has been translated to <lang1>." |
+ // Because <lang1> is displayed in a menu button, the text is split in 2 |
+ // chunks. |
+ static void GetAfterTranslateWithAutoStrings(std::vector<string16>* strings); |
+ |
protected: |
// For testing. |
TranslateInfoBarDelegate(Type infobar_type, |