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

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

Issue 597042: Translate: Move label parsing logic into common code. (Closed)
Patch Set: Fix indentation. Created 10 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
Index: chrome/browser/translate/translate_infobars_delegates.h
diff --git a/chrome/browser/translate/translate_infobars_delegates.h b/chrome/browser/translate/translate_infobars_delegates.h
index 311b847055310a0d6c3949c0be31825416a99dfb..ceeda1787a0b2a7ebc50f472fede7b8973b7363f 100644
--- a/chrome/browser/translate/translate_infobars_delegates.h
+++ b/chrome/browser/translate/translate_infobars_delegates.h
@@ -60,6 +60,21 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
return state_;
}
+ // Retrieve the text for the toolbar label. The toolbar label is a bit
+ // strange since we need to place popup menus inside the string in question.
+ // To do this we use two placeholders.
+ //
+ // |message_text| is the text to display for the label.
+ // |offsets| contains the offsets of the number of placeholders in the text
+ // + message_text->length() i.e. it can contain 2 or 3 elements.
+ // offsets[0] < offsets[1] even in cases where the languages need to be
+ // displayed in reverse order.
+ // |swapped_language_placeholders| is true if we need to flip the order
+ // of the menus in the current locale.
+ void GetMessageText(string16 *message_text,
+ std::vector<size_t> *offsets,
+ bool *swapped_language_placeholders);
+
// Overridden from InfoBarDelegate.
virtual Type GetInfoBarType() {
return PAGE_ACTION_TYPE;

Powered by Google App Engine
This is Rietveld 408576698