Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "device/bluetooth/bluetooth_classic_win.h" | |
| 6 | |
| 7 namespace device { | |
| 8 namespace win { | |
| 9 | |
| 10 static BluetoothClassicWrapper* instance_ = nullptr; | |
|
scheib
2016/02/04 23:36:39
use g_ prefix on the global.
Place the global in
gogerald1
2016/02/04 23:48:59
Done.
| |
| 11 BluetoothClassicWrapper* BluetoothClassicWrapper::GetInstance() { | |
| 12 if (instance_ == nullptr) { | |
| 13 instance_ = new BluetoothClassicWrapper(); | |
| 14 } | |
| 15 return instance_; | |
| 16 } | |
| 17 | |
| 18 void BluetoothClassicWrapper::DeleteInstance() { | |
| 19 delete instance_; | |
| 20 instance_ = nullptr; | |
| 21 } | |
| 22 | |
| 23 void BluetoothClassicWrapper::SetInstanceForTest( | |
| 24 BluetoothClassicWrapper* instance) { | |
| 25 delete instance_; | |
| 26 instance_ = instance; | |
| 27 } | |
| 28 | |
| 29 BluetoothClassicWrapper::BluetoothClassicWrapper() {} | |
| 30 BluetoothClassicWrapper::~BluetoothClassicWrapper() {} | |
| 31 | |
| 32 HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio( | |
| 33 const BLUETOOTH_FIND_RADIO_PARAMS* params, | |
| 34 HANDLE* out_handle) { | |
| 35 return BluetoothFindFirstRadio(params, out_handle); | |
| 36 } | |
| 37 | |
| 38 DWORD BluetoothClassicWrapper::GetRadioInfo( | |
| 39 HANDLE handle, | |
| 40 PBLUETOOTH_RADIO_INFO out_radio_info) { | |
| 41 return BluetoothGetRadioInfo(handle, out_radio_info); | |
| 42 } | |
| 43 | |
| 44 BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) { | |
| 45 return BluetoothFindRadioClose(handle); | |
| 46 } | |
| 47 | |
| 48 BOOL BluetoothClassicWrapper::IsConnectable(HANDLE handle) { | |
| 49 return BluetoothIsConnectable(handle); | |
| 50 } | |
| 51 | |
| 52 HBLUETOOTH_DEVICE_FIND BluetoothClassicWrapper::FindFirstDevice( | |
| 53 const BLUETOOTH_DEVICE_SEARCH_PARAMS* params, | |
| 54 BLUETOOTH_DEVICE_INFO* out_device_info) { | |
| 55 return BluetoothFindFirstDevice(params, out_device_info); | |
| 56 } | |
| 57 | |
| 58 BOOL BluetoothClassicWrapper::FindNextDevice( | |
| 59 HBLUETOOTH_DEVICE_FIND handle, | |
| 60 BLUETOOTH_DEVICE_INFO* out_device_info) { | |
| 61 return BluetoothFindNextDevice(handle, out_device_info); | |
| 62 } | |
| 63 | |
| 64 BOOL BluetoothClassicWrapper::FindDeviceClose(HBLUETOOTH_DEVICE_FIND handle) { | |
| 65 return BluetoothFindDeviceClose(handle); | |
| 66 } | |
| 67 | |
| 68 BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) { | |
| 69 return BluetoothEnableDiscovery(handle, is_enable); | |
| 70 } | |
| 71 | |
| 72 BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle, | |
| 73 BOOL is_enable) { | |
| 74 return BluetoothEnableIncomingConnections(handle, is_enable); | |
| 75 } | |
| 76 | |
| 77 } // namespace win | |
| 78 } // namespace device | |
| OLD | NEW |