| 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 "device/bluetooth/bluetooth_device_chromeos.h" | 5 #include "device/bluetooth/bluetooth_device_chromeos.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 std::string BluetoothDeviceChromeOS::GetDeviceName() const { | 172 std::string BluetoothDeviceChromeOS::GetDeviceName() const { |
| 173 BluetoothDeviceClient::Properties* properties = | 173 BluetoothDeviceClient::Properties* properties = |
| 174 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 174 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
| 175 GetProperties(object_path_); | 175 GetProperties(object_path_); |
| 176 DCHECK(properties); | 176 DCHECK(properties); |
| 177 | 177 |
| 178 return properties->alias.value(); | 178 return properties->alias.value(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void BluetoothDeviceChromeOS::CreateGattConnectionImpl() { |
| 182 // ChromeOS implementation does not use the default CreateGattConnection |
| 183 // implementation. |
| 184 NOTIMPLEMENTED(); |
| 185 } |
| 186 |
| 187 void BluetoothDeviceChromeOS::DisconnectGatt() { |
| 188 // ChromeOS implementation does not use the default CreateGattConnection |
| 189 // implementation. |
| 190 NOTIMPLEMENTED(); |
| 191 } |
| 192 |
| 181 std::string BluetoothDeviceChromeOS::GetAddress() const { | 193 std::string BluetoothDeviceChromeOS::GetAddress() const { |
| 182 BluetoothDeviceClient::Properties* properties = | 194 BluetoothDeviceClient::Properties* properties = |
| 183 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 195 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
| 184 GetProperties(object_path_); | 196 GetProperties(object_path_); |
| 185 DCHECK(properties); | 197 DCHECK(properties); |
| 186 | 198 |
| 187 return CanonicalizeAddress(properties->address.value()); | 199 return CanonicalizeAddress(properties->address.value()); |
| 188 } | 200 } |
| 189 | 201 |
| 190 BluetoothDevice::VendorIDSource | 202 BluetoothDevice::VendorIDSource |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 238 |
| 227 bool BluetoothDeviceChromeOS::IsConnected() const { | 239 bool BluetoothDeviceChromeOS::IsConnected() const { |
| 228 BluetoothDeviceClient::Properties* properties = | 240 BluetoothDeviceClient::Properties* properties = |
| 229 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 241 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
| 230 GetProperties(object_path_); | 242 GetProperties(object_path_); |
| 231 DCHECK(properties); | 243 DCHECK(properties); |
| 232 | 244 |
| 233 return properties->connected.value(); | 245 return properties->connected.value(); |
| 234 } | 246 } |
| 235 | 247 |
| 248 bool BluetoothDeviceChromeOS::IsGattConnected() const { |
| 249 NOTIMPLEMENTED(); |
| 250 return false; |
| 251 } |
| 252 |
| 236 bool BluetoothDeviceChromeOS::IsConnectable() const { | 253 bool BluetoothDeviceChromeOS::IsConnectable() const { |
| 237 BluetoothInputClient::Properties* input_properties = | 254 BluetoothInputClient::Properties* input_properties = |
| 238 DBusThreadManager::Get()->GetBluetoothInputClient()-> | 255 DBusThreadManager::Get()->GetBluetoothInputClient()-> |
| 239 GetProperties(object_path_); | 256 GetProperties(object_path_); |
| 240 // GetProperties returns NULL when the device does not implement the given | 257 // GetProperties returns NULL when the device does not implement the given |
| 241 // interface. Non HID devices are normally connectable. | 258 // interface. Non HID devices are normally connectable. |
| 242 if (!input_properties) | 259 if (!input_properties) |
| 243 return true; | 260 return true; |
| 244 | 261 |
| 245 return input_properties->reconnect_mode.value() != "device"; | 262 return input_properties->reconnect_mode.value() != "device"; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 void BluetoothDeviceChromeOS::OnForgetError( | 729 void BluetoothDeviceChromeOS::OnForgetError( |
| 713 const ErrorCallback& error_callback, | 730 const ErrorCallback& error_callback, |
| 714 const std::string& error_name, | 731 const std::string& error_name, |
| 715 const std::string& error_message) { | 732 const std::string& error_message) { |
| 716 LOG(WARNING) << object_path_.value() << ": Failed to remove device: " | 733 LOG(WARNING) << object_path_.value() << ": Failed to remove device: " |
| 717 << error_name << ": " << error_message; | 734 << error_name << ": " << error_message; |
| 718 error_callback.Run(); | 735 error_callback.Run(); |
| 719 } | 736 } |
| 720 | 737 |
| 721 } // namespace chromeos | 738 } // namespace chromeos |
| OLD | NEW |