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

Unified Diff: chrome/browser/views/shelf_item_dialog.cc

Issue 18076: request review: fix issue 2821 and 6132 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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/views/password_manager_view.cc ('k') | chrome/common/l10n_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/shelf_item_dialog.cc
===================================================================
--- chrome/browser/views/shelf_item_dialog.cc (revision 8587)
+++ chrome/browser/views/shelf_item_dialog.cc (working copy)
@@ -131,12 +131,26 @@
return std::wstring();
}
- if (col_id == IDS_ASI_PAGE_COLUMN)
- return GetTitle(row);
+ if (col_id == IDS_ASI_PAGE_COLUMN) {
+ const std::wstring& title = GetTitle(row);
+ // TODO(xji): Consider adding a special case if the title text is a URL,
+ // since those should always have LTR directionality. Please refer to
+ // http://crbug.com/6726 for more information.
+ std::wstring localized_title;
+ if (l10n_util::AdjustStringForLocaleDirection(title, &localized_title))
+ return localized_title;
+ return title;
+ }
// TODO(brettw): this should probably pass the GURL up so the URL elider
// can be used at a higher level when we know the width.
- return results_[row].display_url.display_url();
+ const std::wstring& url = results_[row].display_url.display_url();
+ if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT)
+ return url;
+ // Force URL to be LTR.
+ std::wstring localized_url = url;
+ l10n_util::WrapStringWithLTRFormatting(&localized_url);
+ return localized_url;
}
virtual SkBitmap GetIcon(int row) {
« no previous file with comments | « chrome/browser/views/password_manager_view.cc ('k') | chrome/common/l10n_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698