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

Unified Diff: android_webview/browser/aw_browser_main_parts.cc

Issue 2235753002: Merge webviewchromium.pak and resources.pak in Monochrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: upstream monochrome asset build Created 4 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/BUILD.gn ('k') | chrome/BUILD.gn » ('j') | chrome/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_browser_main_parts.cc
diff --git a/android_webview/browser/aw_browser_main_parts.cc b/android_webview/browser/aw_browser_main_parts.cc
index b5e62b2f596cf73c96a43452c0231eb7a7aa8dd7..56c9374ab49f79902a0aebce5709dd96758cfc8d 100644
--- a/android_webview/browser/aw_browser_main_parts.cc
+++ b/android_webview/browser/aw_browser_main_parts.cc
@@ -108,10 +108,18 @@ int AwBrowserMainParts::PreCreateThreads() {
// Try to directly mmap the webviewchromium.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("webviewchromium.pak");
- ui::LoadMainAndroidPackFile("assets/webviewchromium.pak", pak_file_path);
+ 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);
+ }
base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(
base::android::AttachCurrentThread());
« no previous file with comments | « android_webview/BUILD.gn ('k') | chrome/BUILD.gn » ('j') | chrome/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698