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

Unified Diff: components/url_formatter/url_formatter.cc

Issue 2839843002: Android URL formatting: Disable RTL URLs for Android 4.2 and below. (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698