| 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 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 GetServiceRegistry()->AddService(base::Bind( | 2034 GetServiceRegistry()->AddService(base::Bind( |
| 2035 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); | 2035 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); |
| 2036 | 2036 |
| 2037 #if !defined(OS_ANDROID) | 2037 #if !defined(OS_ANDROID) |
| 2038 GetServiceRegistry()->AddService( | 2038 GetServiceRegistry()->AddService( |
| 2039 base::Bind(&device::VibrationManagerImpl::Create)); | 2039 base::Bind(&device::VibrationManagerImpl::Create)); |
| 2040 #endif | 2040 #endif |
| 2041 | 2041 |
| 2042 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( | 2042 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2043 switches::kEnableWebBluetooth); | 2043 switches::kEnableWebBluetooth); |
| 2044 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 2044 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) |
| 2045 enable_web_bluetooth = true; | 2045 enable_web_bluetooth = true; |
| 2046 #endif | 2046 #endif |
| 2047 | 2047 |
| 2048 if (enable_web_bluetooth) { | 2048 if (enable_web_bluetooth) { |
| 2049 GetServiceRegistry()->AddService( | 2049 GetServiceRegistry()->AddService( |
| 2050 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, | 2050 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, |
| 2051 base::Unretained(this))); | 2051 base::Unretained(this))); |
| 2052 } | 2052 } |
| 2053 | 2053 |
| 2054 if (!frame_mojo_shell_) | 2054 if (!frame_mojo_shell_) |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2948 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 2949 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2949 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 2950 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2950 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 2951 } | 2951 } |
| 2952 | 2952 |
| 2953 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2953 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 2954 web_bluetooth_service_.reset(); | 2954 web_bluetooth_service_.reset(); |
| 2955 } | 2955 } |
| 2956 | 2956 |
| 2957 } // namespace content | 2957 } // namespace content |
| OLD | NEW |