| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/path_service.h" |
| 13 #include "base/string_tokenizer.h" | 14 #include "base/string_tokenizer.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/app/breakpad_mac.h" | 16 #include "chrome/app/breakpad_mac.h" |
| 16 #include "chrome/browser/browser_about_handler.h" | 17 #include "chrome/browser/browser_about_handler.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 20 #include "chrome/browser/character_encoding.h" | 21 #include "chrome/browser/character_encoding.h" |
| 21 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 22 #include "chrome/browser/chrome_benchmarking_message_filter.h" |
| 22 #include "chrome/browser/chrome_quota_permission_context.h" | 23 #include "chrome/browser/chrome_quota_permission_context.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #elif defined(OS_MACOSX) | 113 #elif defined(OS_MACOSX) |
| 113 #include "chrome/browser/chrome_browser_main_mac.h" | 114 #include "chrome/browser/chrome_browser_main_mac.h" |
| 114 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 115 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
| 115 #elif defined(OS_CHROMEOS) | 116 #elif defined(OS_CHROMEOS) |
| 116 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 117 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 117 #include "chrome/browser/chromeos/login/user_manager.h" | 118 #include "chrome/browser/chromeos/login/user_manager.h" |
| 118 #elif defined(OS_LINUX) | 119 #elif defined(OS_LINUX) |
| 119 #include "chrome/browser/chrome_browser_main_linux.h" | 120 #include "chrome/browser/chrome_browser_main_linux.h" |
| 120 #elif defined(OS_ANDROID) | 121 #elif defined(OS_ANDROID) |
| 121 #include "chrome/browser/chrome_browser_main_android.h" | 122 #include "chrome/browser/chrome_browser_main_android.h" |
| 123 #include "chrome/common/descriptors_android.h" |
| 122 #elif defined(OS_POSIX) | 124 #elif defined(OS_POSIX) |
| 123 #include "chrome/browser/chrome_browser_main_posix.h" | 125 #include "chrome/browser/chrome_browser_main_posix.h" |
| 124 #endif | 126 #endif |
| 125 | 127 |
| 126 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_ANDROID) | 128 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_ANDROID) |
| 127 #include "base/linux_util.h" | 129 #include "base/linux_util.h" |
| 128 #include "chrome/browser/crash_handler_host_linux.h" | 130 #include "chrome/browser/crash_handler_host_linux.h" |
| 129 #endif | 131 #endif |
| 130 | 132 |
| 131 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 133 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 132 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 134 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 133 #endif | 135 #endif |
| 134 | 136 |
| 137 #if defined(OS_ANDROID) |
| 138 #include "ui/base/ui_base_paths.h" |
| 139 #endif |
| 140 |
| 135 #if defined(USE_NSS) | 141 #if defined(USE_NSS) |
| 136 #include "chrome/browser/ui/crypto_module_password_dialog.h" | 142 #include "chrome/browser/ui/crypto_module_password_dialog.h" |
| 137 #endif | 143 #endif |
| 138 | 144 |
| 139 using base::FileDescriptor; | 145 using base::FileDescriptor; |
| 140 using content::AccessTokenStore; | 146 using content::AccessTokenStore; |
| 141 using content::BrowserThread; | 147 using content::BrowserThread; |
| 142 using content::BrowserURLHandler; | 148 using content::BrowserURLHandler; |
| 143 using content::ChildProcessSecurityPolicy; | 149 using content::ChildProcessSecurityPolicy; |
| 144 using content::FileDescriptorInfo; | 150 using content::FileDescriptorInfo; |
| (...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1746 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 1741 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 1747 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 1742 const CommandLine& command_line, | 1748 const CommandLine& command_line, |
| 1743 std::vector<FileDescriptorInfo>* mappings) { | 1749 std::vector<FileDescriptorInfo>* mappings) { |
| 1744 int crash_signal_fd = GetCrashSignalFD(command_line); | 1750 int crash_signal_fd = GetCrashSignalFD(command_line); |
| 1745 if (crash_signal_fd >= 0) { | 1751 if (crash_signal_fd >= 0) { |
| 1746 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, | 1752 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, |
| 1747 FileDescriptor(crash_signal_fd, | 1753 FileDescriptor(crash_signal_fd, |
| 1748 false))); | 1754 false))); |
| 1749 } | 1755 } |
| 1756 #if defined(OS_ANDROID) |
| 1757 FilePath data_path; |
| 1758 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
| 1759 DCHECK(!data_path.empty()); |
| 1760 |
| 1761 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
| 1762 FilePath chrome_pak = data_path.AppendASCII("chrome.pak"); |
| 1763 base::PlatformFile f = |
| 1764 base::CreatePlatformFile(chrome_pak, flags, NULL, NULL); |
| 1765 DCHECK(f != base::kInvalidPlatformFileValue); |
| 1766 mappings->push_back(FileDescriptorInfo(kAndroidChromePakDescriptor, |
| 1767 FileDescriptor(f, true))); |
| 1768 |
| 1769 FilePath chrome_resources_pak = |
| 1770 data_path.AppendASCII("chrome_100_percent.pak"); |
| 1771 f = base::CreatePlatformFile(chrome_resources_pak, flags, NULL, NULL); |
| 1772 DCHECK(f != base::kInvalidPlatformFileValue); |
| 1773 mappings->push_back(FileDescriptorInfo(kAndroidUIResourcesPakDescriptor, |
| 1774 FileDescriptor(f, true))); |
| 1775 |
| 1776 const std::string locale = GetApplicationLocale(); |
| 1777 FilePath locale_pak = ResourceBundle::GetSharedInstance(). |
| 1778 GetLocaleFilePath(locale, false); |
| 1779 f = base::CreatePlatformFile(locale_pak, flags, NULL, NULL); |
| 1780 DCHECK(f != base::kInvalidPlatformFileValue); |
| 1781 mappings->push_back(FileDescriptorInfo(kAndroidLocalePakDescriptor, |
| 1782 FileDescriptor(f, true))); |
| 1783 #endif // defined(OS_ANDROID) |
| 1750 } | 1784 } |
| 1751 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 1785 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 1752 | 1786 |
| 1753 #if defined(OS_WIN) | 1787 #if defined(OS_WIN) |
| 1754 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { | 1788 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { |
| 1755 return chrome::kBrowserResourcesDll; | 1789 return chrome::kBrowserResourcesDll; |
| 1756 } | 1790 } |
| 1757 #endif | 1791 #endif |
| 1758 | 1792 |
| 1759 #if defined(USE_NSS) | 1793 #if defined(USE_NSS) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 partition_id = extension->id(); | 1837 partition_id = extension->id(); |
| 1804 } | 1838 } |
| 1805 | 1839 |
| 1806 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1840 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
| 1807 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1841 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
| 1808 return partition_id; | 1842 return partition_id; |
| 1809 } | 1843 } |
| 1810 | 1844 |
| 1811 | 1845 |
| 1812 } // namespace chrome | 1846 } // namespace chrome |
| OLD | NEW |