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 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2171 if (base::FeatureList::IsEnabled(media::kAndroidMediaPlayerRenderer)) { | 2171 if (base::FeatureList::IsEnabled(media::kAndroidMediaPlayerRenderer)) { |
2172 // Creates a MojoRendererService, passing it a MediaPlayerRender. | 2172 // Creates a MojoRendererService, passing it a MediaPlayerRender. |
2173 GetInterfaceRegistry()->AddInterface<media::mojom::Renderer>(base::Bind( | 2173 GetInterfaceRegistry()->AddInterface<media::mojom::Renderer>(base::Bind( |
2174 &content::CreateMediaPlayerRenderer, base::Unretained(this))); | 2174 &content::CreateMediaPlayerRenderer, base::Unretained(this))); |
2175 } | 2175 } |
2176 #else | 2176 #else |
2177 GetInterfaceRegistry()->AddInterface( | 2177 GetInterfaceRegistry()->AddInterface( |
2178 base::Bind(&device::VibrationManagerImpl::Create)); | 2178 base::Bind(&device::VibrationManagerImpl::Create)); |
2179 #endif // defined(OS_ANDROID) | 2179 #endif // defined(OS_ANDROID) |
2180 | 2180 |
2181 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( | 2181 GetInterfaceRegistry()->AddInterface(base::Bind( |
2182 switches::kEnableWebBluetooth); | 2182 base::IgnoreResult(&RenderFrameHostImpl::CreateWebBluetoothService), |
2183 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) | 2183 base::Unretained(this))); |
2184 enable_web_bluetooth = true; | |
2185 #endif | |
2186 | |
2187 if (enable_web_bluetooth) { | |
2188 GetInterfaceRegistry()->AddInterface(base::Bind( | |
2189 base::IgnoreResult(&RenderFrameHostImpl::CreateWebBluetoothService), | |
2190 base::Unretained(this))); | |
2191 } | |
2192 | 2184 |
2193 GetInterfaceRegistry()->AddInterface<media::mojom::InterfaceFactory>(this); | 2185 GetInterfaceRegistry()->AddInterface<media::mojom::InterfaceFactory>(this); |
2194 | 2186 |
2195 // This is to support usage of WebSockets in cases in which there is an | 2187 // This is to support usage of WebSockets in cases in which there is an |
2196 // associated RenderFrame. This is important for showing the correct security | 2188 // associated RenderFrame. This is important for showing the correct security |
2197 // state of the page and also honoring user override of bad certificates. | 2189 // state of the page and also honoring user override of bad certificates. |
2198 GetInterfaceRegistry()->AddInterface( | 2190 GetInterfaceRegistry()->AddInterface( |
2199 base::Bind(&WebSocketManager::CreateWebSocket, | 2191 base::Bind(&WebSocketManager::CreateWebSocket, |
2200 process_->GetID(), | 2192 process_->GetID(), |
2201 routing_id_)); | 2193 routing_id_)); |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3141 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3150 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3142 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3151 return web_bluetooth_service_.get(); | 3143 return web_bluetooth_service_.get(); |
3152 } | 3144 } |
3153 | 3145 |
3154 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3146 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3155 web_bluetooth_service_.reset(); | 3147 web_bluetooth_service_.reset(); |
3156 } | 3148 } |
3157 | 3149 |
3158 } // namespace content | 3150 } // namespace content |
OLD | NEW |