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

Unified Diff: ui/base/resource/resource_bundle_android.cc

Issue 1193613002: Convert Android WebView to store locale .pak files as res/raw resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-extractor-init
Patch Set: rebase again 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
« no previous file with comments | « ui/base/resource/resource_bundle_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_android.cc
diff --git a/ui/base/resource/resource_bundle_android.cc b/ui/base/resource/resource_bundle_android.cc
index bcf306b0ad9fa6be4172b077713fd1adda5224dd..a1a4d00a41580ff7de82c72c5865dd27a91440cd 100644
--- a/ui/base/resource/resource_bundle_android.cc
+++ b/ui/base/resource/resource_bundle_android.cc
@@ -90,12 +90,15 @@ int GetCommonResourcesPackFd(base::MemoryMappedFile::Region* out_region) {
return g_chrome_100_percent_fd;
}
-bool AssetContainedInApk(const std::string& filename) {
+std::string GetPathForAndroidLocalePakWithinApk(const std::string& locale) {
JNIEnv* env = base::android::AttachCurrentThread();
- return Java_ResourceBundle_assetContainedInApk(
- env,
- base::android::GetApplicationContext(),
- base::android::ConvertUTF8ToJavaString(env, filename).obj());
+ base::android::ScopedJavaLocalRef<jstring> ret =
+ Java_ResourceBundle_getLocalePakResourcePath(
+ env, base::android::ConvertUTF8ToJavaString(env, locale).obj());
+ if (ret.obj() == nullptr) {
+ return std::string();
+ }
+ return base::android::ConvertJavaStringToUTF8(env, ret.obj());
}
bool RegisterResourceBundleAndroid(JNIEnv* env) {
« no previous file with comments | « ui/base/resource/resource_bundle_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698