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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 switches::kAppsGalleryURL, | 1645 switches::kAppsGalleryURL, |
1644 switches::kCloudPrintURL, | 1646 switches::kCloudPrintURL, |
1645 switches::kCloudPrintXmppEndpoint, | 1647 switches::kCloudPrintXmppEndpoint, |
1646 switches::kDisableBundledPpapiFlash, | 1648 switches::kDisableBundledPpapiFlash, |
1647 switches::kDisablePnacl, | 1649 switches::kDisablePnacl, |
1648 switches::kDisableScriptedPrintThrottling, | 1650 switches::kDisableScriptedPrintThrottling, |
1649 switches::kEnableAppView, | 1651 switches::kEnableAppView, |
1650 switches::kEnableAppWindowControls, | 1652 switches::kEnableAppWindowControls, |
1651 switches::kEnableBenchmarking, | 1653 switches::kEnableBenchmarking, |
1652 switches::kEnableNaCl, | 1654 switches::kEnableNaCl, |
| 1655 #if !defined(DISABLE_NACL) |
1653 switches::kEnableNaClDebug, | 1656 switches::kEnableNaClDebug, |
1654 switches::kEnableNaClNonSfiMode, | 1657 switches::kEnableNaClNonSfiMode, |
| 1658 #endif |
1655 switches::kEnableNetBenchmarking, | 1659 switches::kEnableNetBenchmarking, |
1656 switches::kEnableShowModalDialog, | 1660 switches::kEnableShowModalDialog, |
1657 switches::kEnableStreamlinedHostedApps, | 1661 switches::kEnableStreamlinedHostedApps, |
1658 switches::kEnableWatchdog, | 1662 switches::kEnableWatchdog, |
1659 switches::kEnableWebBasedSignin, | 1663 switches::kEnableWebBasedSignin, |
1660 switches::kMessageLoopHistogrammer, | 1664 switches::kMessageLoopHistogrammer, |
1661 switches::kOutOfProcessPdf, | 1665 switches::kOutOfProcessPdf, |
1662 switches::kPlaybackMode, | 1666 switches::kPlaybackMode, |
1663 switches::kPpapiFlashArgs, | 1667 switches::kPpapiFlashArgs, |
1664 switches::kPpapiFlashPath, | 1668 switches::kPpapiFlashPath, |
(...skipping 23 matching lines...) Expand all Loading... |
1688 chromeos::switches::kLoginProfile, | 1692 chromeos::switches::kLoginProfile, |
1689 }; | 1693 }; |
1690 | 1694 |
1691 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1695 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
1692 arraysize(kSwitchNames)); | 1696 arraysize(kSwitchNames)); |
1693 #endif | 1697 #endif |
1694 } else if (process_type == switches::kZygoteProcess) { | 1698 } else if (process_type == switches::kZygoteProcess) { |
1695 static const char* const kSwitchNames[] = { | 1699 static const char* const kSwitchNames[] = { |
1696 // 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. |
1697 switches::kDisableBundledPpapiFlash, | 1701 switches::kDisableBundledPpapiFlash, |
| 1702 #if !defined(DISABLE_NACL) |
1698 switches::kEnableNaClNonSfiMode, | 1703 switches::kEnableNaClNonSfiMode, |
1699 switches::kNaClDangerousNoSandboxNonSfi, | 1704 switches::kNaClDangerousNoSandboxNonSfi, |
| 1705 #endif |
1700 switches::kPpapiFlashPath, | 1706 switches::kPpapiFlashPath, |
1701 switches::kPpapiFlashVersion, | 1707 switches::kPpapiFlashVersion, |
1702 }; | 1708 }; |
1703 | 1709 |
1704 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 1710 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
1705 arraysize(kSwitchNames)); | 1711 arraysize(kSwitchNames)); |
1706 } else if (process_type == switches::kGpuProcess) { | 1712 } else if (process_type == switches::kGpuProcess) { |
1707 // If --ignore-gpu-blacklist is passed in, don't send in crash reports | 1713 // If --ignore-gpu-blacklist is passed in, don't send in crash reports |
1708 // because GPU is expected to be unreliable. | 1714 // because GPU is expected to be unreliable. |
1709 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && | 1715 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 #if defined(ENABLE_PLUGINS) | 2570 #if defined(ENABLE_PLUGINS) |
2565 browser_host->GetPpapiHost()->AddHostFactoryFilter( | 2571 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
2566 scoped_ptr<ppapi::host::HostFactory>( | 2572 scoped_ptr<ppapi::host::HostFactory>( |
2567 new ChromeBrowserPepperHostFactory(browser_host))); | 2573 new ChromeBrowserPepperHostFactory(browser_host))); |
2568 #endif | 2574 #endif |
2569 } | 2575 } |
2570 | 2576 |
2571 content::BrowserPpapiHost* | 2577 content::BrowserPpapiHost* |
2572 ChromeContentBrowserClient::GetExternalBrowserPpapiHost( | 2578 ChromeContentBrowserClient::GetExternalBrowserPpapiHost( |
2573 int plugin_process_id) { | 2579 int plugin_process_id) { |
2574 BrowserChildProcessHostIterator iter(PROCESS_TYPE_NACL_LOADER); | 2580 #if !defined(DISABLE_NACL) |
| 2581 content::BrowserChildProcessHostIterator iter(PROCESS_TYPE_NACL_LOADER); |
2575 while (!iter.Done()) { | 2582 while (!iter.Done()) { |
2576 nacl::NaClProcessHost* host = static_cast<nacl::NaClProcessHost*>( | 2583 nacl::NaClProcessHost* host = static_cast<nacl::NaClProcessHost*>( |
2577 iter.GetDelegate()); | 2584 iter.GetDelegate()); |
2578 if (host->process() && | 2585 if (host->process() && |
2579 host->process()->GetData().id == plugin_process_id) { | 2586 host->process()->GetData().id == plugin_process_id) { |
2580 // Found the plugin. | 2587 // Found the plugin. |
2581 return host->browser_ppapi_host(); | 2588 return host->browser_ppapi_host(); |
2582 } | 2589 } |
2583 ++iter; | 2590 ++iter; |
2584 } | 2591 } |
| 2592 #endif |
2585 return NULL; | 2593 return NULL; |
2586 } | 2594 } |
2587 | 2595 |
2588 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 2596 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
2589 content::BrowserContext* browser_context, | 2597 content::BrowserContext* browser_context, |
2590 const GURL& url, | 2598 const GURL& url, |
2591 bool private_api, | 2599 bool private_api, |
2592 const content::SocketPermissionRequest* params) { | 2600 const content::SocketPermissionRequest* params) { |
2593 #if defined(ENABLE_PLUGINS) | 2601 #if defined(ENABLE_PLUGINS) |
2594 Profile* profile = Profile::FromBrowserContext(browser_context); | 2602 Profile* profile = Profile::FromBrowserContext(browser_context); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 switches::kDisableWebRtcEncryption, | 2904 switches::kDisableWebRtcEncryption, |
2897 }; | 2905 }; |
2898 to_command_line->CopySwitchesFrom(from_command_line, | 2906 to_command_line->CopySwitchesFrom(from_command_line, |
2899 kWebRtcDevSwitchNames, | 2907 kWebRtcDevSwitchNames, |
2900 arraysize(kWebRtcDevSwitchNames)); | 2908 arraysize(kWebRtcDevSwitchNames)); |
2901 } | 2909 } |
2902 } | 2910 } |
2903 #endif // defined(ENABLE_WEBRTC) | 2911 #endif // defined(ENABLE_WEBRTC) |
2904 | 2912 |
2905 } // namespace chrome | 2913 } // namespace chrome |
OLD | NEW |