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

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

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.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,
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/browser/translate/translate_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698