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

Unified Diff: chrome/browser/ui/toolbar/back_forward_menu_model.cc

Issue 6894009: Change NavigationEntry's title fields to carry the text direction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/back_forward_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
index 95770034011538466dfbcbb5182efbb46e1c2bbe..b73deefcd54636fdf15e51f1b9ca361a6aa445da 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
@@ -84,19 +84,22 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const {
// Return the entry title, escaping any '&' characters and eliding it if it's
// super long.
NavigationEntry* entry = GetNavigationEntry(index);
- string16 menu_text(entry->GetTitleForDisplay(
+ base::i18n::String16WithDirection menu_text(entry->GetTitleForDisplay(
GetTabContents()->profile()->GetPrefs()->
GetString(prefs::kAcceptLanguages)));
- menu_text = ui::ElideText(menu_text, gfx::Font(), kMaxWidth, false);
+ string16 elided =
+ ui::ElideText(menu_text.string(), gfx::Font(), kMaxWidth, false);
#if !defined(OS_MACOSX)
- for (size_t i = menu_text.find('&'); i != string16::npos;
- i = menu_text.find('&', i + 2)) {
- menu_text.insert(i, 1, '&');
+ for (size_t i = elided.find('&'); i != string16::npos;
+ i = elided.find('&', i + 2)) {
+ elided.insert(i, 1, '&');
}
#endif
- return menu_text;
+ // TODO(evan): use directionality of title.
+ // http://code.google.com/p/chromium/issues/detail?id=27094
+ return elided;
}
bool BackForwardMenuModel::IsItemDynamicAt(int index) const {
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698