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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2481293004: Use LocaleList in Android/Webview locale representation (Closed)
Patch Set: Created 4 years, 1 month 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 | base/BUILD.gn » ('j') | base/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 45a360b4f9da94ff9fe8607a1c29090fe6c44221..5b8fb14d74cf369c75543a238d2c92f13a927424 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -693,7 +693,11 @@ public class AwContents implements SmartClipProvider,
@Override
public void onConfigurationChanged(Configuration configuration) {
- setLocale(LocaleUtils.toLanguageTag(configuration.locale));
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ setLocale(LocaleUtils.toLanguageTags(configuration.getLocales()));
+ } else {
+ setLocale(LocaleUtils.toLanguageTag(configuration.locale));
+ }
mSettings.updateAcceptLanguages();
}
};
@@ -1002,6 +1006,7 @@ public class AwContents implements SmartClipProvider,
return wrapper;
}
+ // Deal with a string represents either single locale or a locale list
Seigo Nonaka 2016/11/08 09:31:11 Then, lets change the argument name to "locales".
Yirui Huang 2016/11/08 10:39:31 Done.
@VisibleForTesting
public static void setLocale(String locale) {
if (!sCurrentLocale.equals(locale)) {
« no previous file with comments | « no previous file | base/BUILD.gn » ('j') | base/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698