Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index 7d52975570876db9451e6286ff71ec380dd0d091..bd0803f767e1d92355d90305624dee3c0bb79c94 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -10,6 +10,7 @@ |
#include "base/bind.h" |
#include "base/command_line.h" |
+#include "base/path_service.h" |
#include "base/string_tokenizer.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/app/breakpad_mac.h" |
@@ -116,6 +117,7 @@ |
#include "chrome/browser/chrome_browser_main_linux.h" |
#elif defined(OS_ANDROID) |
#include "chrome/browser/chrome_browser_main_android.h" |
+#include "chrome/common/descriptors_android.h" |
#elif defined(OS_POSIX) |
#include "chrome/browser/chrome_browser_main_posix.h" |
#endif |
@@ -125,6 +127,10 @@ |
#include "chrome/browser/crash_handler_host_linux.h" |
#endif |
+#if defined(OS_ANDROID) |
+#include "ui/base/ui_base_paths.h" |
+#endif |
+ |
#if defined(USE_NSS) |
#include "chrome/browser/ui/crypto_module_password_dialog.h" |
#endif |
@@ -1676,6 +1682,34 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( |
kCrashDumpSignal, crash_signal_fd)); |
} |
+#if defined(OS_ANDROID) |
+ FilePath data_path; |
+ PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
+ DCHECK(!data_path.empty()); |
+ |
+ int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
+ FilePath chrome_pak = data_path.AppendASCII("chrome.pak"); |
+ base::PlatformFile f = |
+ base::CreatePlatformFile(chrome_pak, flags, NULL, NULL); |
+ DCHECK(f != base::kInvalidPlatformFileValue); |
+ mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( |
+ kAndroidChromePakDescriptor, f)); |
+ |
+ FilePath chrome_resources_pak = |
+ data_path.AppendASCII("chrome_100_percent.pak"); |
+ f = base::CreatePlatformFile(chrome_resources_pak, flags, NULL, NULL); |
+ DCHECK(f != base::kInvalidPlatformFileValue); |
+ mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( |
+ kAndroidUIResourcesPakDescriptor, f)); |
+ |
+ const std::string locale = GetApplicationLocale(); |
+ FilePath locale_pak = ResourceBundle::GetSharedInstance(). |
+ GetLocaleFilePath(locale, false); |
+ f = base::CreatePlatformFile(locale_pak, flags, NULL, NULL); |
+ DCHECK(f != base::kInvalidPlatformFileValue); |
+ mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( |
+ kAndroidLocalePakDescriptor, f)); |
+#endif // defined(OS_ANDROID) |
} |
#endif // defined(OS_POSIX) && !defined(OS_MACOSX) |