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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_api_utils.cc

Issue 1420973007: Add connecting/connectable to bluetooth.Device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_543294_bluetooth_options_2a_broadcast
Patch Set: Rebase Created 5 years, 1 month 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 | « no previous file | extensions/common/api/bluetooth.idl » ('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 "extensions/browser/api/bluetooth/bluetooth_api_utils.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "device/bluetooth/bluetooth_adapter.h" 9 #include "device/bluetooth/bluetooth_adapter.h"
10 #include "device/bluetooth/bluetooth_device.h" 10 #include "device/bluetooth/bluetooth_device.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 out->vendor_id_source != VENDOR_ID_SOURCE_NONE) { 104 out->vendor_id_source != VENDOR_ID_SOURCE_NONE) {
105 out->vendor_id.reset(new int(device.GetVendorID())); 105 out->vendor_id.reset(new int(device.GetVendorID()));
106 out->product_id.reset(new int(device.GetProductID())); 106 out->product_id.reset(new int(device.GetProductID()));
107 out->device_id.reset(new int(device.GetDeviceID())); 107 out->device_id.reset(new int(device.GetDeviceID()));
108 } 108 }
109 109
110 ConvertDeviceTypeToApi(device.GetDeviceType(), &(out->type)); 110 ConvertDeviceTypeToApi(device.GetDeviceType(), &(out->type));
111 111
112 out->paired.reset(new bool(device.IsPaired())); 112 out->paired.reset(new bool(device.IsPaired()));
113 out->connected.reset(new bool(device.IsConnected())); 113 out->connected.reset(new bool(device.IsConnected()));
114 out->connecting.reset(new bool(device.IsConnecting()));
115 out->connectable.reset(new bool(device.IsConnectable()));
114 116
115 std::vector<std::string>* string_uuids = new std::vector<std::string>(); 117 std::vector<std::string>* string_uuids = new std::vector<std::string>();
116 const device::BluetoothDevice::UUIDList& uuids = device.GetUUIDs(); 118 const device::BluetoothDevice::UUIDList& uuids = device.GetUUIDs();
117 for (device::BluetoothDevice::UUIDList::const_iterator iter = uuids.begin(); 119 for (device::BluetoothDevice::UUIDList::const_iterator iter = uuids.begin();
118 iter != uuids.end(); ++iter) 120 iter != uuids.end(); ++iter)
119 string_uuids->push_back(iter->canonical_value()); 121 string_uuids->push_back(iter->canonical_value());
120 out->uuids.reset(string_uuids); 122 out->uuids.reset(string_uuids);
121 123
122 if (device.GetInquiryRSSI() != device::BluetoothDevice::kUnknownPower) 124 if (device.GetInquiryRSSI() != device::BluetoothDevice::kUnknownPower)
123 out->inquiry_rssi.reset(new int(device.GetInquiryRSSI())); 125 out->inquiry_rssi.reset(new int(device.GetInquiryRSSI()));
(...skipping 11 matching lines...) Expand all
135 out->discovering = adapter.IsDiscovering(); 137 out->discovering = adapter.IsDiscovering();
136 out->available = adapter.IsPresent(); 138 out->available = adapter.IsPresent();
137 out->powered = adapter.IsPowered(); 139 out->powered = adapter.IsPowered();
138 out->name = adapter.GetName(); 140 out->name = adapter.GetName();
139 out->address = adapter.GetAddress(); 141 out->address = adapter.GetAddress();
140 } 142 }
141 143
142 } // namespace bluetooth 144 } // namespace bluetooth
143 } // namespace api 145 } // namespace api
144 } // namespace extensions 146 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/api/bluetooth.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698