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

Unified Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 2176463002: Default page title (the page's URL) is now in an LTR embedding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 | « no previous file | content/browser/frame_host/navigation_entry_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_entry_impl.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 97413c7b639baf003f4afc20a781f3c034f989d5..f4bd66aac9d8352a18a6ba18a2ffd4ef9db0335c 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -10,6 +10,7 @@
#include <utility>
#include "base/debug/dump_without_crashing.h"
+#include "base/i18n/rtl.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
@@ -418,6 +419,12 @@ const base::string16& NavigationEntryImpl::GetTitleForDisplay() const {
base::string16::size_type slashpos = title.rfind('/', lastpos);
if (slashpos != base::string16::npos)
title = title.substr(slashpos + 1);
+ } else if (base::i18n::StringContainsStrongRTLChars(title)) {
+ // Wrap the URL in an LTR embedding for proper handling of RTL characters.
+ // (RFC 3987 Section 4.1 states that "Bidirectional IRIs MUST be rendered in
+ // the same way as they would be if they were in a left-to-right
+ // embedding".)
+ base::i18n::WrapStringWithLTRFormatting(&title);
}
gfx::ElideString(title, kMaxTitleChars, &cached_display_title_);
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_entry_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698