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.h" | 5 #include "device/bluetooth/bluetooth_device.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/time/time.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
13 #include "device/bluetooth/bluetooth_adapter.h" | 14 #include "device/bluetooth/bluetooth_adapter.h" |
14 #include "device/bluetooth/bluetooth_gatt_connection.h" | 15 #include "device/bluetooth/bluetooth_gatt_connection.h" |
15 #include "device/bluetooth/bluetooth_gatt_service.h" | 16 #include "device/bluetooth/bluetooth_gatt_service.h" |
16 #include "grit/bluetooth_strings.h" | 17 #include "grit/bluetooth_strings.h" |
17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
18 | 19 |
19 namespace device { | 20 namespace device { |
20 | 21 |
21 BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter) | 22 BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter) |
22 : adapter_(adapter), | 23 : adapter_(adapter), |
23 gatt_services_discovery_complete_(false), | 24 gatt_services_discovery_complete_(false), |
24 services_data_(new base::DictionaryValue()) {} | 25 services_data_(new base::DictionaryValue()), |
| 26 last_update_time_(base::Time()) {} |
25 | 27 |
26 BluetoothDevice::~BluetoothDevice() { | 28 BluetoothDevice::~BluetoothDevice() { |
27 DidDisconnectGatt(); | 29 DidDisconnectGatt(); |
28 } | 30 } |
29 | 31 |
30 BluetoothDevice::ConnectionInfo::ConnectionInfo() | 32 BluetoothDevice::ConnectionInfo::ConnectionInfo() |
31 : rssi(kUnknownPower), | 33 : rssi(kUnknownPower), |
32 transmit_power(kUnknownPower), | 34 transmit_power(kUnknownPower), |
33 max_transmit_power(kUnknownPower) {} | 35 max_transmit_power(kUnknownPower) {} |
34 | 36 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 services_data_->Set(serviceUUID.value(), | 380 services_data_->Set(serviceUUID.value(), |
379 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); | 381 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); |
380 } | 382 } |
381 | 383 |
382 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, | 384 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, |
383 const base::Closure& callback, | 385 const base::Closure& callback, |
384 const ConnectErrorCallback& error_callback) { | 386 const ConnectErrorCallback& error_callback) { |
385 NOTREACHED(); | 387 NOTREACHED(); |
386 } | 388 } |
387 | 389 |
| 390 void BluetoothDevice::UpdateTimestamp() { |
| 391 last_update_time_ = base::Time::NowFromSystemTime(); |
| 392 } |
| 393 |
388 } // namespace device | 394 } // namespace device |
OLD | NEW |