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

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: Rebase Created 5 years, 4 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 | « android_webview/native/webview_native.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 809fd6e9dabb39de02348865a2d5aa9e77427286..5c26e7a50c28618ad009b7499bd1954b44b4541c 100644
--- a/base/android/java/src/org/chromium/base/LocaleUtils.java
+++ b/base/android/java/src/org/chromium/base/LocaleUtils.java
@@ -19,12 +19,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();
@@ -43,6 +42,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.
*/
« no previous file with comments | « android_webview/native/webview_native.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698