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