Index: components/url_formatter/url_formatter.cc |
diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc |
index d54b67913ce76d400907266963475bae6920cdd9..718049566937fdd987e6d8d2e43a6648566ac6d5 100644 |
--- a/components/url_formatter/url_formatter.cc |
+++ b/components/url_formatter/url_formatter.cc |
@@ -25,6 +25,11 @@ |
#include "url/gurl.h" |
#include "url/third_party/mozilla/url_parse.h" |
+#if defined(OS_ANDROID) |
+#include "base/android/build_info.h" |
+#include "base/i18n/rtl.h" |
+#endif |
+ |
namespace url_formatter { |
namespace { |
@@ -825,6 +830,14 @@ base::string16 FormatUrlWithAdjustments( |
AdjustAllComponentsButScheme(delta, new_parsed); |
} |
+#if defined(OS_ANDROID) |
+ // Android versions 4.2 and before have broken RTL support. |
+ if (base::android::BuildInfo::GetInstance()->sdk_int() <= |
+ base::android::SDK_VERSION_JELLY_BEAN_MR1) { |
+ url_string = base::i18n::GetDisplayStringInLTRDirectionality(url_string); |
tommycli
2017/04/25 00:06:21
Hey, I'm not sure this is the correct thing to do.
Matt Giuca
2017/04/26 00:01:05
It's probably the case that they are all three byt
Matt Giuca
2017/04/26 05:57:09
After we had a chat:
It looks like this *is* the
tommycli
2017/04/27 01:36:33
You're right, this does mess up the copy and paste
|
+ } |
+#endif |
+ |
return url_string; |
} |