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

Unified Diff: chrome/browser/task_manager_resource_providers.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/task_manager.cc ('k') | chrome/browser/views/hung_renderer_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager_resource_providers.cc
===================================================================
--- chrome/browser/task_manager_resource_providers.cc (revision 8587)
+++ chrome/browser/task_manager_resource_providers.cc (working copy)
@@ -48,8 +48,23 @@
// Fall back on the URL if there's no title.
std::wstring tab_title(web_contents_->GetTitle());
- if (tab_title.empty())
+ if (tab_title.empty()) {
tab_title = UTF8ToWide(web_contents_->GetURL().spec());
+ // Force URL to be LTR.
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
+ l10n_util::WrapStringWithLTRFormatting(&tab_title);
+ } else {
+ // Since the tab_title will be concatenated with
+ // IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to
+ // be LTR format if there is no strong RTL charater in it. Otherwise, if
+ // IDS_TASK_MANAGER_TAB_PREFIX is an RTL word, the concatenated result
+ // might be wrong. For example, http://mail.yahoo.com, whose title is
+ // "Yahoo! Mail: The best web-based Email!", without setting it explicitly
+ // as LTR format, the concatenated result will be "!Yahoo! Mail: The best
+ // web-based Email :BAT", in which the capital letters "BAT" stands for
+ // the Hebrew word for "tab".
+ l10n_util::AdjustStringForLocaleDirection(tab_title, &tab_title);
+ }
return l10n_util::GetStringF(IDS_TASK_MANAGER_TAB_PREFIX, tab_title);
}
@@ -253,6 +268,11 @@
plugin_name = info.name;
else
plugin_name = l10n_util::GetString(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME);
+ // Explicitly mark plugin_name as LTR if there is no strong RTL character,
+ // to avoid the wrong concatenation result similar to "!Yahoo! Mail: the
+ // best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew
+ // or Arabic word for "plugin".
+ l10n_util::AdjustStringForLocaleDirection(plugin_name, &plugin_name);
title_ = l10n_util::GetStringF(IDS_TASK_MANAGER_PLUGIN_PREFIX,
plugin_name);
}
« no previous file with comments | « chrome/browser/task_manager.cc ('k') | chrome/browser/views/hung_renderer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698