| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #include "content/public/browser/permission_manager.h" | 75 #include "content/public/browser/permission_manager.h" |
| 76 #include "content/public/browser/permission_type.h" | 76 #include "content/public/browser/permission_type.h" |
| 77 #include "content/public/browser/render_process_host.h" | 77 #include "content/public/browser/render_process_host.h" |
| 78 #include "content/public/browser/render_widget_host_view.h" | 78 #include "content/public/browser/render_widget_host_view.h" |
| 79 #include "content/public/browser/resource_context.h" | 79 #include "content/public/browser/resource_context.h" |
| 80 #include "content/public/browser/storage_partition.h" | 80 #include "content/public/browser/storage_partition.h" |
| 81 #include "content/public/browser/stream_handle.h" | 81 #include "content/public/browser/stream_handle.h" |
| 82 #include "content/public/browser/user_metrics.h" | 82 #include "content/public/browser/user_metrics.h" |
| 83 #include "content/public/common/browser_side_navigation_policy.h" | 83 #include "content/public/common/browser_side_navigation_policy.h" |
| 84 #include "content/public/common/content_constants.h" | 84 #include "content/public/common/content_constants.h" |
| 85 #include "content/public/common/content_features.h" |
| 85 #include "content/public/common/content_switches.h" | 86 #include "content/public/common/content_switches.h" |
| 86 #include "content/public/common/file_chooser_file_info.h" | 87 #include "content/public/common/file_chooser_file_info.h" |
| 87 #include "content/public/common/file_chooser_params.h" | 88 #include "content/public/common/file_chooser_params.h" |
| 88 #include "content/public/common/isolated_world_ids.h" | 89 #include "content/public/common/isolated_world_ids.h" |
| 89 #include "content/public/common/service_manager_connection.h" | 90 #include "content/public/common/service_manager_connection.h" |
| 90 #include "content/public/common/url_constants.h" | 91 #include "content/public/common/url_constants.h" |
| 91 #include "content/public/common/url_utils.h" | 92 #include "content/public/common/url_utils.h" |
| 92 #include "device/generic_sensor/sensor_provider_impl.h" | 93 #include "device/generic_sensor/sensor_provider_impl.h" |
| 93 #include "device/geolocation/geolocation_service_context.h" | 94 #include "device/geolocation/geolocation_service_context.h" |
| 94 #include "device/vibration/vibration_manager_impl.h" | 95 #include "device/vibration/vibration_manager_impl.h" |
| (...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 // state of the page and also honoring user override of bad certificates. | 2212 // state of the page and also honoring user override of bad certificates. |
| 2212 GetInterfaceRegistry()->AddInterface( | 2213 GetInterfaceRegistry()->AddInterface( |
| 2213 base::Bind(&WebSocketManager::CreateWebSocket, | 2214 base::Bind(&WebSocketManager::CreateWebSocket, |
| 2214 process_->GetID(), | 2215 process_->GetID(), |
| 2215 routing_id_)); | 2216 routing_id_)); |
| 2216 | 2217 |
| 2217 #if defined(ENABLE_WEBVR) | 2218 #if defined(ENABLE_WEBVR) |
| 2218 GetInterfaceRegistry()->AddInterface<device::VRService>( | 2219 GetInterfaceRegistry()->AddInterface<device::VRService>( |
| 2219 base::Bind(&device::VRServiceImpl::BindRequest)); | 2220 base::Bind(&device::VRServiceImpl::BindRequest)); |
| 2220 #endif | 2221 #endif |
| 2221 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2222 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { |
| 2222 switches::kEnableGenericSensors)) { | |
| 2223 GetInterfaceRegistry()->AddInterface( | 2223 GetInterfaceRegistry()->AddInterface( |
| 2224 base::Bind(&device::SensorProviderImpl::Create), | 2224 base::Bind(&device::SensorProviderImpl::Create), |
| 2225 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 2225 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 2226 } | 2226 } |
| 2227 | 2227 |
| 2228 #if defined(ENABLE_WEBRTC) | 2228 #if defined(ENABLE_WEBRTC) |
| 2229 // BrowserMainLoop::GetInstance() may be null on unit tests. | 2229 // BrowserMainLoop::GetInstance() may be null on unit tests. |
| 2230 if (BrowserMainLoop::GetInstance()) { | 2230 if (BrowserMainLoop::GetInstance()) { |
| 2231 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime | 2231 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime |
| 2232 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | 2232 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3153 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3153 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3154 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3154 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3155 return web_bluetooth_service_.get(); | 3155 return web_bluetooth_service_.get(); |
| 3156 } | 3156 } |
| 3157 | 3157 |
| 3158 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3158 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3159 web_bluetooth_service_.reset(); | 3159 web_bluetooth_service_.reset(); |
| 3160 } | 3160 } |
| 3161 | 3161 |
| 3162 } // namespace content | 3162 } // namespace content |
| OLD | NEW |