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

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

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback. Created 6 years, 9 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
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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "net/base/net_log.h"
14 15
15 namespace device { 16 namespace device {
16 17
17 class BluetoothProfile; 18 class BluetoothProfile;
18 class BluetoothServiceRecord; 19 class BluetoothServiceRecord;
19 class BluetoothSocket; 20 class BluetoothSocket;
20 21
21 struct BluetoothOutOfBandPairingData; 22 struct BluetoothOutOfBandPairingData;
22 23
23 // BluetoothDevice represents a remote Bluetooth device, both its properties and 24 // BluetoothDevice represents a remote Bluetooth device, both its properties and
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // were called after the corresponding call to Connect(). 234 // were called after the corresponding call to Connect().
234 virtual bool IsConnecting() const = 0; 235 virtual bool IsConnecting() const = 0;
235 236
236 // Returns the services (as UUID strings) that this device provides. 237 // Returns the services (as UUID strings) that this device provides.
237 // TODO(youngki): Rename this to GetProfiles(). 238 // TODO(youngki): Rename this to GetProfiles().
238 typedef std::vector<std::string> ServiceList; 239 typedef std::vector<std::string> ServiceList;
239 virtual ServiceList GetServices() const = 0; 240 virtual ServiceList GetServices() const = 0;
240 241
241 // The ErrorCallback is used for methods that can fail in which case it 242 // The ErrorCallback is used for methods that can fail in which case it
242 // is called, in the success case the callback is simply not called. 243 // is called, in the success case the callback is simply not called.
243 typedef base::Callback<void()> ErrorCallback; 244 typedef base::Callback<void(const std::string&)> ErrorCallback;
keybuk 2014/03/20 01:21:56 What are the possible values of this string? Is th
rpaquay 2014/03/20 18:21:11 The intent is to provide a descriptive error messa
keybuk 2014/03/20 18:38:40 Okay, is the policy that those are always English?
rpaquay 2014/03/25 20:06:10 Yeah, the message are always English, and platform
244 245
245 // The ConnectErrorCallback is used for methods that can fail with an error, 246 // The ConnectErrorCallback is used for methods that can fail with an error,
246 // passed back as an error code argument to this callback. 247 // passed back as an error code argument to this callback.
247 // In the success case this callback is not called. 248 // In the success case this callback is not called.
248 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback; 249 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback;
249 250
250 // Returns the services (as BluetoothServiceRecord objects) that this device 251 // Returns the services (as BluetoothServiceRecord objects) that this device
251 // provides. 252 // provides.
252 typedef ScopedVector<BluetoothServiceRecord> ServiceRecordList; 253 typedef ScopedVector<BluetoothServiceRecord> ServiceRecordList;
253 typedef base::Callback<void(const ServiceRecordList&)> ServiceRecordsCallback; 254 typedef base::Callback<void(const ServiceRecordList&)> ServiceRecordsCallback;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 382
382 private: 383 private:
383 // Returns a localized string containing the device's bluetooth address and 384 // Returns a localized string containing the device's bluetooth address and
384 // a device type for display when |name_| is empty. 385 // a device type for display when |name_| is empty.
385 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 386 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
386 }; 387 };
387 388
388 } // namespace device 389 } // namespace device
389 390
390 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 391 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698