Chromium Code Reviews| 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 a0a31c4cb0eeb855de089ebcf852eecc9a74ef65..8d287954120fe736aaae2aa5799439e79a25b7e5 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" |
| @@ -114,6 +115,9 @@ |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| #elif defined(OS_LINUX) |
| #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 |
| @@ -123,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 |
| @@ -1680,6 +1688,32 @@ 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); |
| + if (f == base::kInvalidPlatformFileValue) { |
|
agl
2012/08/30 01:31:47
This looks like a DCHECK. Also, if this fails then
acleung
2012/08/31 23:36:33
Done.
|
| + NOTREACHED() << "Failed to open file when creating renderer process: " |
| + << "chrome.pak"; |
| + } |
| + 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); |
| + if (f == base::kInvalidPlatformFileValue) { |
| + NOTREACHED() << "Failed to open file when creating renderer process: " |
| + << chrome_resources_pak.value(); |
| + } |
| + mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>( |
| + kAndroidUIResourcesPakDescriptor, f)); |
| +#endif // defined(OS_ANDROID) |
| } |
| #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |