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

Unified Diff: base/android/java/src/org/chromium/base/LocaleUtils.java

Issue 1172093002: Implement HttpUserAgentSettings delegate for Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New plumbing Created 5 years, 6 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
Index: base/android/java/src/org/chromium/base/LocaleUtils.java
diff --git a/base/android/java/src/org/chromium/base/LocaleUtils.java b/base/android/java/src/org/chromium/base/LocaleUtils.java
index 82b2c8fc6667cd7ccc7cd96c58bfaef8d76ab595..93d4f3234a41de2c016d602a5b5ee23c5a830304 100644
--- a/base/android/java/src/org/chromium/base/LocaleUtils.java
+++ b/base/android/java/src/org/chromium/base/LocaleUtils.java
@@ -17,12 +17,11 @@ public class LocaleUtils {
}
/**
- * @return the default locale, translating Android deprecated
- * language codes into the modern ones used by Chromium.
+ * @return the string for the given locale, translating
+ * Android deprecated language codes into the modern ones
+ * used by Chromium.
*/
- @CalledByNative
- public static String getDefaultLocale() {
- Locale locale = Locale.getDefault();
+ public static String getLocale(Locale locale) {
String language = locale.getLanguage();
String country = locale.getCountry();
@@ -41,6 +40,15 @@ public class LocaleUtils {
}
/**
+ * @return the default locale, translating Android deprecated
+ * language codes into the modern ones used by Chromium.
+ */
+ @CalledByNative
+ public static String getDefaultLocale() {
+ return getLocale(Locale.getDefault());
+ }
+
+ /**
* Get the default country code set during install.
* @return country code.
*/

Powered by Google App Engine
This is Rietveld 408576698