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 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #include "chrome/common/logging_chrome.h" | 94 #include "chrome/common/logging_chrome.h" |
95 #include "chrome/common/pepper_permission_util.h" | 95 #include "chrome/common/pepper_permission_util.h" |
96 #include "chrome/common/pref_names.h" | 96 #include "chrome/common/pref_names.h" |
97 #include "chrome/common/render_messages.h" | 97 #include "chrome/common/render_messages.h" |
98 #include "chrome/common/url_constants.h" | 98 #include "chrome/common/url_constants.h" |
99 #include "chrome/installer/util/google_update_settings.h" | 99 #include "chrome/installer/util/google_update_settings.h" |
100 #include "chromeos/chromeos_constants.h" | 100 #include "chromeos/chromeos_constants.h" |
101 #include "components/cdm/browser/cdm_message_filter_android.h" | 101 #include "components/cdm/browser/cdm_message_filter_android.h" |
102 #include "components/cloud_devices/common/cloud_devices_switches.h" | 102 #include "components/cloud_devices/common/cloud_devices_switches.h" |
103 #include "components/google/core/browser/google_util.h" | 103 #include "components/google/core/browser/google_util.h" |
| 104 #include "components/nacl/browser/nacl_browser.h" |
| 105 #include "components/nacl/browser/nacl_host_message_filter.h" |
| 106 #include "components/nacl/browser/nacl_process_host.h" |
| 107 #include "components/nacl/common/nacl_process_type.h" |
| 108 #include "components/nacl/common/nacl_switches.h" |
104 #include "components/pref_registry/pref_registry_syncable.h" | 109 #include "components/pref_registry/pref_registry_syncable.h" |
105 #include "components/signin/core/common/profile_management_switches.h" | 110 #include "components/signin/core/common/profile_management_switches.h" |
106 #include "components/translate/core/common/translate_switches.h" | 111 #include "components/translate/core/common/translate_switches.h" |
107 #include "content/public/browser/browser_child_process_host.h" | 112 #include "content/public/browser/browser_child_process_host.h" |
108 #include "content/public/browser/browser_main_parts.h" | 113 #include "content/public/browser/browser_main_parts.h" |
109 #include "content/public/browser/browser_ppapi_host.h" | 114 #include "content/public/browser/browser_ppapi_host.h" |
110 #include "content/public/browser/browser_thread.h" | 115 #include "content/public/browser/browser_thread.h" |
111 #include "content/public/browser/browser_url_handler.h" | 116 #include "content/public/browser/browser_url_handler.h" |
112 #include "content/public/browser/child_process_data.h" | 117 #include "content/public/browser/child_process_data.h" |
113 #include "content/public/browser/child_process_security_policy.h" | 118 #include "content/public/browser/child_process_security_policy.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 #endif | 221 #endif |
217 | 222 |
218 #if defined(USE_X11) | 223 #if defined(USE_X11) |
219 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" | 224 #include "chrome/browser/chrome_browser_main_extra_parts_x11.h" |
220 #endif | 225 #endif |
221 | 226 |
222 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 227 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
223 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 228 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
224 #endif | 229 #endif |
225 | 230 |
226 #if !defined(DISABLE_NACL) | |
227 #include "components/nacl/browser/nacl_browser.h" | |
228 #include "components/nacl/browser/nacl_host_message_filter.h" | |
229 #include "components/nacl/browser/nacl_process_host.h" | |
230 #include "components/nacl/common/nacl_process_type.h" | |
231 #include "components/nacl/common/nacl_switches.h" | |
232 #endif | |
233 | |
234 #if defined(ENABLE_EXTENSIONS) | 231 #if defined(ENABLE_EXTENSIONS) |
235 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 232 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
236 #include "chrome/browser/guest_view/guest_view_base.h" | 233 #include "chrome/browser/guest_view/guest_view_base.h" |
237 #include "chrome/browser/guest_view/guest_view_constants.h" | 234 #include "chrome/browser/guest_view/guest_view_constants.h" |
238 #include "chrome/browser/guest_view/guest_view_manager.h" | 235 #include "chrome/browser/guest_view/guest_view_manager.h" |
239 #include "chrome/browser/guest_view/web_view/web_view_guest.h" | 236 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
240 #include "chrome/browser/guest_view/web_view/web_view_permission_helper.h" | 237 #include "chrome/browser/guest_view/web_view/web_view_permission_helper.h" |
241 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h" | 238 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h" |
242 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" | 239 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" |
243 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 240 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
244 #endif | 241 #endif |
245 | 242 |
246 #if defined(ENABLE_SPELLCHECK) | 243 #if defined(ENABLE_SPELLCHECK) |
247 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 244 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
248 #endif | 245 #endif |
249 | 246 |
250 #if defined(ENABLE_SERVICE_DISCOVERY) | 247 #if defined(ENABLE_SERVICE_DISCOVERY) |
251 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" | 248 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" |
252 #endif | 249 #endif |
253 | 250 |
254 #if defined(ENABLE_WEBRTC) | 251 #if defined(ENABLE_WEBRTC) |
255 #include "chrome/browser/media/webrtc_logging_handler_host.h" | 252 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
256 #endif | 253 #endif |
257 | 254 |
258 using base::FileDescriptor; | 255 using base::FileDescriptor; |
259 using blink::WebWindowFeatures; | 256 using blink::WebWindowFeatures; |
260 using content::AccessTokenStore; | 257 using content::AccessTokenStore; |
| 258 using content::BrowserChildProcessHostIterator; |
261 using content::BrowserThread; | 259 using content::BrowserThread; |
262 using content::BrowserURLHandler; | 260 using content::BrowserURLHandler; |
263 using content::ChildProcessSecurityPolicy; | 261 using content::ChildProcessSecurityPolicy; |
264 using content::QuotaPermissionContext; | 262 using content::QuotaPermissionContext; |
265 using content::RenderFrameHost; | 263 using content::RenderFrameHost; |
266 using content::RenderViewHost; | 264 using content::RenderViewHost; |
267 using content::ResourceType; | 265 using content::ResourceType; |
268 using content::SiteInstance; | 266 using content::SiteInstance; |
269 using content::WebContents; | 267 using content::WebContents; |
270 using content::WebPreferences; | 268 using content::WebPreferences; |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 switches::kAppsGalleryURL, | 1647 switches::kAppsGalleryURL, |
1650 switches::kCloudPrintURL, | 1648 switches::kCloudPrintURL, |
1651 switches::kCloudPrintXmppEndpoint, | 1649 switches::kCloudPrintXmppEndpoint, |
1652 switches::kDisableBundledPpapiFlash, | 1650 switches::kDisableBundledPpapiFlash, |
1653 switches::kDisablePnacl, | 1651 switches::kDisablePnacl, |
1654 switches::kDisableScriptedPrintThrottling, | 1652 switches::kDisableScriptedPrintThrottling, |
1655 switches::kEnableAppView, | 1653 switches::kEnableAppView, |
1656 switches::kEnableAppWindowControls, | 1654 switches::kEnableAppWindowControls, |
1657 switches::kEnableBenchmarking, | 1655 switches::kEnableBenchmarking, |
1658 switches::kEnableNaCl, | 1656 switches::kEnableNaCl, |
1659 #if !defined(DISABLE_NACL) | |
1660 switches::kEnableNaClDebug, | 1657 switches::kEnableNaClDebug, |
1661 switches::kEnableNaClNonSfiMode, | 1658 switches::kEnableNaClNonSfiMode, |
1662 #endif | |
1663 switches::kEnableNetBenchmarking, | 1659 switches::kEnableNetBenchmarking, |
1664 switches::kEnableShowModalDialog, | 1660 switches::kEnableShowModalDialog, |
1665 switches::kEnableStreamlinedHostedApps, | 1661 switches::kEnableStreamlinedHostedApps, |
1666 switches::kEnableWatchdog, | 1662 switches::kEnableWatchdog, |
1667 switches::kEnableWebBasedSignin, | 1663 switches::kEnableWebBasedSignin, |
1668 switches::kMessageLoopHistogrammer, | 1664 switches::kMessageLoopHistogrammer, |
1669 switches::kOutOfProcessPdf, | 1665 switches::kOutOfProcessPdf, |
1670 switches::kPlaybackMode, | 1666 switches::kPlaybackMode, |
1671 switches::kPpapiFlashArgs, | 1667 switches::kPpapiFlashArgs, |
1672 switches::kPpapiFlashPath, | 1668 switches::kPpapiFlashPath, |
(...skipping 23 matching lines...) Expand all Loading... |
1696 chromeos::switches::kLoginProfile, | 1692 chromeos::switches::kLoginProfile, |
1697 }; | 1693 }; |
1698 | 1694 |
1699 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1695 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
1700 arraysize(kSwitchNames)); | 1696 arraysize(kSwitchNames)); |
1701 #endif | 1697 #endif |
1702 } else if (process_type == switches::kZygoteProcess) { | 1698 } else if (process_type == switches::kZygoteProcess) { |
1703 static const char* const kSwitchNames[] = { | 1699 static const char* const kSwitchNames[] = { |
1704 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. | 1700 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. |
1705 switches::kDisableBundledPpapiFlash, | 1701 switches::kDisableBundledPpapiFlash, |
1706 #if !defined(DISABLE_NACL) | |
1707 switches::kEnableNaClNonSfiMode, | 1702 switches::kEnableNaClNonSfiMode, |
1708 switches::kNaClDangerousNoSandboxNonSfi, | 1703 switches::kNaClDangerousNoSandboxNonSfi, |
1709 #endif | |
1710 switches::kPpapiFlashPath, | 1704 switches::kPpapiFlashPath, |
1711 switches::kPpapiFlashVersion, | 1705 switches::kPpapiFlashVersion, |
1712 }; | 1706 }; |
1713 | 1707 |
1714 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1708 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
1715 arraysize(kSwitchNames)); | 1709 arraysize(kSwitchNames)); |
1716 } else if (process_type == switches::kGpuProcess) { | 1710 } else if (process_type == switches::kGpuProcess) { |
1717 // If --ignore-gpu-blacklist is passed in, don't send in crash reports | 1711 // If --ignore-gpu-blacklist is passed in, don't send in crash reports |
1718 // because GPU is expected to be unreliable. | 1712 // because GPU is expected to be unreliable. |
1719 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && | 1713 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 #if defined(ENABLE_PLUGINS) | 2575 #if defined(ENABLE_PLUGINS) |
2582 browser_host->GetPpapiHost()->AddHostFactoryFilter( | 2576 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
2583 scoped_ptr<ppapi::host::HostFactory>( | 2577 scoped_ptr<ppapi::host::HostFactory>( |
2584 new ChromeBrowserPepperHostFactory(browser_host))); | 2578 new ChromeBrowserPepperHostFactory(browser_host))); |
2585 #endif | 2579 #endif |
2586 } | 2580 } |
2587 | 2581 |
2588 content::BrowserPpapiHost* | 2582 content::BrowserPpapiHost* |
2589 ChromeContentBrowserClient::GetExternalBrowserPpapiHost( | 2583 ChromeContentBrowserClient::GetExternalBrowserPpapiHost( |
2590 int plugin_process_id) { | 2584 int plugin_process_id) { |
2591 #if !defined(DISABLE_NACL) | 2585 BrowserChildProcessHostIterator iter(PROCESS_TYPE_NACL_LOADER); |
2592 content::BrowserChildProcessHostIterator iter(PROCESS_TYPE_NACL_LOADER); | |
2593 while (!iter.Done()) { | 2586 while (!iter.Done()) { |
2594 nacl::NaClProcessHost* host = static_cast<nacl::NaClProcessHost*>( | 2587 nacl::NaClProcessHost* host = static_cast<nacl::NaClProcessHost*>( |
2595 iter.GetDelegate()); | 2588 iter.GetDelegate()); |
2596 if (host->process() && | 2589 if (host->process() && |
2597 host->process()->GetData().id == plugin_process_id) { | 2590 host->process()->GetData().id == plugin_process_id) { |
2598 // Found the plugin. | 2591 // Found the plugin. |
2599 return host->browser_ppapi_host(); | 2592 return host->browser_ppapi_host(); |
2600 } | 2593 } |
2601 ++iter; | 2594 ++iter; |
2602 } | 2595 } |
2603 #endif | |
2604 return NULL; | 2596 return NULL; |
2605 } | 2597 } |
2606 | 2598 |
2607 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 2599 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
2608 content::BrowserContext* browser_context, | 2600 content::BrowserContext* browser_context, |
2609 const GURL& url, | 2601 const GURL& url, |
2610 bool private_api, | 2602 bool private_api, |
2611 const content::SocketPermissionRequest* params) { | 2603 const content::SocketPermissionRequest* params) { |
2612 #if defined(ENABLE_PLUGINS) | 2604 #if defined(ENABLE_PLUGINS) |
2613 Profile* profile = Profile::FromBrowserContext(browser_context); | 2605 Profile* profile = Profile::FromBrowserContext(browser_context); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 switches::kDisableWebRtcEncryption, | 2907 switches::kDisableWebRtcEncryption, |
2916 }; | 2908 }; |
2917 to_command_line->CopySwitchesFrom(from_command_line, | 2909 to_command_line->CopySwitchesFrom(from_command_line, |
2918 kWebRtcDevSwitchNames, | 2910 kWebRtcDevSwitchNames, |
2919 arraysize(kWebRtcDevSwitchNames)); | 2911 arraysize(kWebRtcDevSwitchNames)); |
2920 } | 2912 } |
2921 } | 2913 } |
2922 #endif // defined(ENABLE_WEBRTC) | 2914 #endif // defined(ENABLE_WEBRTC) |
2923 | 2915 |
2924 } // namespace chrome | 2916 } // namespace chrome |
OLD | NEW |