| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_device_win.h" | 5 #include "device/bluetooth/bluetooth_device_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return 0; | 80 return 0; |
| 81 } | 81 } |
| 82 | 82 |
| 83 uint16_t BluetoothDeviceWin::GetAppearance() const { | 83 uint16_t BluetoothDeviceWin::GetAppearance() const { |
| 84 // TODO(crbug.com/588083): Implementing GetAppearance() | 84 // TODO(crbug.com/588083): Implementing GetAppearance() |
| 85 // on mac, win, and android platforms for chrome | 85 // on mac, win, and android platforms for chrome |
| 86 NOTIMPLEMENTED(); | 86 NOTIMPLEMENTED(); |
| 87 return 0; | 87 return 0; |
| 88 } | 88 } |
| 89 | 89 |
| 90 base::Optional<std::string> BluetoothDeviceWin::GetName() const { |
| 91 return name_; |
| 92 } |
| 93 |
| 90 bool BluetoothDeviceWin::IsPaired() const { | 94 bool BluetoothDeviceWin::IsPaired() const { |
| 91 return paired_; | 95 return paired_; |
| 92 } | 96 } |
| 93 | 97 |
| 94 bool BluetoothDeviceWin::IsConnected() const { | 98 bool BluetoothDeviceWin::IsConnected() const { |
| 95 return connected_; | 99 return connected_; |
| 96 } | 100 } |
| 97 | 101 |
| 98 bool BluetoothDeviceWin::IsGattConnected() const { | 102 bool BluetoothDeviceWin::IsGattConnected() const { |
| 99 NOTIMPLEMENTED(); | 103 NOTIMPLEMENTED(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // Note: Callers are responsible for providing a canonicalized address. | 282 // Note: Callers are responsible for providing a canonicalized address. |
| 279 DCHECK_EQ(address_, BluetoothDevice::CanonicalizeAddress(address_)); | 283 DCHECK_EQ(address_, BluetoothDevice::CanonicalizeAddress(address_)); |
| 280 name_ = device_state.name; | 284 name_ = device_state.name; |
| 281 bluetooth_class_ = device_state.bluetooth_class; | 285 bluetooth_class_ = device_state.bluetooth_class; |
| 282 visible_ = device_state.visible; | 286 visible_ = device_state.visible; |
| 283 connected_ = device_state.connected; | 287 connected_ = device_state.connected; |
| 284 paired_ = device_state.authenticated; | 288 paired_ = device_state.authenticated; |
| 285 UpdateServices(device_state); | 289 UpdateServices(device_state); |
| 286 } | 290 } |
| 287 | 291 |
| 288 std::string BluetoothDeviceWin::GetDeviceName() const { | |
| 289 return name_; | |
| 290 } | |
| 291 | |
| 292 void BluetoothDeviceWin::CreateGattConnectionImpl() { | 292 void BluetoothDeviceWin::CreateGattConnectionImpl() { |
| 293 // Windows implementation does not use the default CreateGattConnection | 293 // Windows implementation does not use the default CreateGattConnection |
| 294 // implementation. | 294 // implementation. |
| 295 NOTIMPLEMENTED(); | 295 NOTIMPLEMENTED(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void BluetoothDeviceWin::DisconnectGatt() { | 298 void BluetoothDeviceWin::DisconnectGatt() { |
| 299 // Windows implementation does not use the default CreateGattConnection | 299 // Windows implementation does not use the default CreateGattConnection |
| 300 // implementation. | 300 // implementation. |
| 301 NOTIMPLEMENTED(); | 301 NOTIMPLEMENTED(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 primary_service->GetIdentifier(), | 394 primary_service->GetIdentifier(), |
| 395 std::unique_ptr<BluetoothRemoteGattService>(primary_service)); | 395 std::unique_ptr<BluetoothRemoteGattService>(primary_service)); |
| 396 adapter_->NotifyGattServiceAdded(primary_service); | 396 adapter_->NotifyGattServiceAdded(primary_service); |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 adapter_->NotifyGattServicesDiscovered(this); | 400 adapter_->NotifyGattServicesDiscovered(this); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace device | 403 } // namespace device |
| OLD | NEW |