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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 GetInterfaceRegistry()->AddInterface(base::Bind( | 2040 GetInterfaceRegistry()->AddInterface(base::Bind( |
2041 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); | 2041 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); |
2042 | 2042 |
2043 #if !defined(OS_ANDROID) | 2043 #if !defined(OS_ANDROID) |
2044 GetInterfaceRegistry()->AddInterface( | 2044 GetInterfaceRegistry()->AddInterface( |
2045 base::Bind(&device::VibrationManagerImpl::Create)); | 2045 base::Bind(&device::VibrationManagerImpl::Create)); |
2046 #endif | 2046 #endif |
2047 | 2047 |
2048 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( | 2048 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( |
2049 switches::kEnableWebBluetooth); | 2049 switches::kEnableWebBluetooth); |
2050 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 2050 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) |
2051 enable_web_bluetooth = true; | 2051 enable_web_bluetooth = true; |
2052 #endif | 2052 #endif |
2053 | 2053 |
2054 if (enable_web_bluetooth) { | 2054 if (enable_web_bluetooth) { |
2055 GetInterfaceRegistry()->AddInterface( | 2055 GetInterfaceRegistry()->AddInterface( |
2056 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, | 2056 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, |
2057 base::Unretained(this))); | 2057 base::Unretained(this))); |
2058 } | 2058 } |
2059 | 2059 |
2060 if (!frame_mojo_shell_) | 2060 if (!frame_mojo_shell_) |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2960 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
2961 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2961 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
2962 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2962 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
2963 } | 2963 } |
2964 | 2964 |
2965 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2965 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
2966 web_bluetooth_service_.reset(); | 2966 web_bluetooth_service_.reset(); |
2967 } | 2967 } |
2968 | 2968 |
2969 } // namespace content | 2969 } // namespace content |
OLD | NEW |