diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 07:27:42 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 07:27:42 +0000 |
commit | c32d31eab915dcff1f128bf744ced2ad8fa221ef (patch) | |
tree | 69a8fbf3b9360c6401bb4658893cafc4b2f209ed /chrome/browser/ui/views | |
parent | 6ee50a8d443f48e70921a8eed76f26a6e9844228 (diff) | |
download | chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.zip chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.tar.gz chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.tar.bz2 |
Cleanup AdjustStringForLocaleDirection() to modify input parameter in place.
As described in the bug, the current behavior is confusing and bug-prone.
BUG=47194
TEST=Check that there are no visible regressions in RTL and LTR language UIs on Linux & Windows.
Review URL: http://codereview.chromium.org/5154009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r-- | chrome/browser/ui/views/bookmark_bar_view.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/hung_renderer_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/options/passwords_page_view.cc | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc index 439df1d..6226524 100644 --- a/chrome/browser/ui/views/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmark_bar_view.cc @@ -143,9 +143,8 @@ static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, // First the title. if (!title.empty()) { - std::wstring localized_title; - if (!base::i18n::AdjustStringForLocaleDirection(title, &localized_title)) - localized_title = title; + std::wstring localized_title = title; + base::i18n::AdjustStringForLocaleDirection(&localized_title); result.append(UTF16ToWideHack(gfx::ElideText(WideToUTF16Hack( localized_title), tt_font, max_width, false))); } diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 3482380..b50debf 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -97,7 +97,7 @@ std::wstring HungPagesTableModel::GetText(int row, int column_id) { // 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. - base::i18n::AdjustStringForLocaleDirection(title, &title); + base::i18n::AdjustStringForLocaleDirection(&title); return title; } diff --git a/chrome/browser/ui/views/options/passwords_page_view.cc b/chrome/browser/ui/views/options/passwords_page_view.cc index 6d22d5e..e33b0b6 100644 --- a/chrome/browser/ui/views/options/passwords_page_view.cc +++ b/chrome/browser/ui/views/options/passwords_page_view.cc @@ -82,7 +82,7 @@ std::wstring PasswordsTableModel::GetText(int row, } case IDS_PASSWORDS_PAGE_VIEW_USERNAME_COLUMN: { // Username. std::wstring username = GetPasswordFormAt(row)->username_value; - base::i18n::AdjustStringForLocaleDirection(username, &username); + base::i18n::AdjustStringForLocaleDirection(&username); return username; } default: |