Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 1284073002: bluetooth: Add adapter to BluetoothDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-drop-callback-
Patch Set: Merge TOT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/values.h" 12 #include "base/values.h"
13 #include "device/bluetooth/bluetooth_gatt_service.h" 13 #include "device/bluetooth/bluetooth_gatt_service.h"
14 #include "grit/bluetooth_strings.h" 14 #include "grit/bluetooth_strings.h"
15 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
16 16
17 namespace device { 17 namespace device {
18 18
19 BluetoothDevice::BluetoothDevice() 19 BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter)
20 : services_data_(new base::DictionaryValue()) {} 20 : adapter_(adapter), services_data_(new base::DictionaryValue()) {}
21 21
22 BluetoothDevice::~BluetoothDevice() { 22 BluetoothDevice::~BluetoothDevice() {
23 STLDeleteValues(&gatt_services_); 23 STLDeleteValues(&gatt_services_);
24 } 24 }
25 25
26 BluetoothDevice::ConnectionInfo::ConnectionInfo() 26 BluetoothDevice::ConnectionInfo::ConnectionInfo()
27 : rssi(kUnknownPower), 27 : rssi(kUnknownPower),
28 transmit_power(kUnknownPower), 28 transmit_power(kUnknownPower),
29 max_transmit_power(kUnknownPower) {} 29 max_transmit_power(kUnknownPower) {}
30 30
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 void BluetoothDevice::ClearServiceData() { services_data_->Clear(); } 276 void BluetoothDevice::ClearServiceData() { services_data_->Clear(); }
277 277
278 void BluetoothDevice::SetServiceData(BluetoothUUID serviceUUID, 278 void BluetoothDevice::SetServiceData(BluetoothUUID serviceUUID,
279 const char* buffer, size_t size) { 279 const char* buffer, size_t size) {
280 services_data_->Set(serviceUUID.value(), 280 services_data_->Set(serviceUUID.value(),
281 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); 281 base::BinaryValue::CreateWithCopiedBuffer(buffer, size));
282 } 282 }
283 283
284 } // namespace device 284 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698