Fix missing monochrome resources.
As a result of https://codereview.chromium.org/2235753002
monochrome was failing to find some resources. Instead of
looking in two places for the PAK files this CL changes
the organization of the webview PAK files to match those
of Chrome, hence allowing identical behaviour for
Monochrome and isolated Webview.
In doing so it reverts the changes to resource_bundle_android.*
that were made in the previous CL.
BUG=634358
Review-Url: https://codereview.chromium.org/2248743002
Cr-Commit-Position: refs/heads/master@{#412218}
diff --git a/android_webview/browser/aw_browser_main_parts.cc b/android_webview/browser/aw_browser_main_parts.cc
index 56c9374..769fcf4 100644
--- a/android_webview/browser/aw_browser_main_parts.cc
+++ b/android_webview/browser/aw_browser_main_parts.cc
@@ -99,27 +99,19 @@
std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale(
base::android::GetDefaultLocale(),
NULL,
- ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
+ ui::ResourceBundle::LOAD_COMMON_RESOURCES);
if (locale.empty()) {
LOG(WARNING) << "Failed to load locale .pak from the apk. "
"Bringing up WebView without any locale";
}
base::i18n::SetICUDefaultLocale(locale);
- // Try to directly mmap the webviewchromium.pak from the apk. Fall back to
- // load from file, using PATH_SERVICE, otherwise.
- base::FilePath base_pak_file_path;
- PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &base_pak_file_path);
- // If Webview is a separate APK from Chrome then it uses webviewchromium.pak
- base::FilePath webview_pak_file_path = base_pak_file_path.AppendASCII(
- "webviewchromium.pak");
- if (!ui::LoadMainAndroidPackFile("assets/webviewchromium.pak",
- webview_pak_file_path)) {
- // If it the same APK as Chrome (Monochrome) then it shares resources.pak
- base::FilePath chromium_pak_file_path = base_pak_file_path.AppendASCII(
- "resources.pak");
- ui::LoadMainAndroidPackFile("assets/resources.pak", chromium_pak_file_path);
- }
+ // Try to directly mmap the resources.pak from the apk. Fall back to load
+ // from file, using PATH_SERVICE, otherwise.
+ base::FilePath pak_file_path;
+ PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path);
+ pak_file_path = pak_file_path.AppendASCII("resources.pak");
+ ui::LoadMainAndroidPackFile("assets/resources.pak", pak_file_path);
base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(
base::android::AttachCurrentThread());