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

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

Issue 1256313002: bluetooth: android: Implement & test CreateGattConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split tests up into smaller tests Created 5 years, 2 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_adapter.cc ('k') | device/bluetooth/bluetooth_device.cc » ('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 #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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/gtest_prod_util.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
16 #include "device/bluetooth/bluetooth_export.h" 17 #include "device/bluetooth/bluetooth_export.h"
17 #include "device/bluetooth/bluetooth_uuid.h" 18 #include "device/bluetooth/bluetooth_uuid.h"
18 #include "net/log/net_log.h" 19 #include "net/log/net_log.h"
19 20
20 namespace base { 21 namespace base {
21 class BinaryValue; 22 class BinaryValue;
22 } 23 }
23 24
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 virtual UUIDList GetServiceDataUUIDs() const; 429 virtual UUIDList GetServiceDataUUIDs() const;
429 430
430 // Returns the |address| in the canonical format: XX:XX:XX:XX:XX:XX, where 431 // Returns the |address| in the canonical format: XX:XX:XX:XX:XX:XX, where
431 // each 'X' is a hex digit. If the input |address| is invalid, returns an 432 // each 'X' is a hex digit. If the input |address| is invalid, returns an
432 // empty string. 433 // empty string.
433 static std::string CanonicalizeAddress(const std::string& address); 434 static std::string CanonicalizeAddress(const std::string& address);
434 435
435 protected: 436 protected:
436 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection. 437 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection.
437 friend BluetoothGattConnection; 438 friend BluetoothGattConnection;
439 FRIEND_TEST_ALL_PREFIXES(
440 BluetoothTest,
441 BluetoothGattConnection_DisconnectGatt_SimulateConnect);
442 FRIEND_TEST_ALL_PREFIXES(
443 BluetoothTest,
444 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect);
445 FRIEND_TEST_ALL_PREFIXES(BluetoothTest,
446 BluetoothGattConnection_ErrorAfterConnection);
438 447
439 BluetoothDevice(BluetoothAdapter* adapter); 448 BluetoothDevice(BluetoothAdapter* adapter);
440 449
441 // Returns the internal name of the Bluetooth device, used by GetName(). 450 // Returns the internal name of the Bluetooth device, used by GetName().
442 virtual std::string GetDeviceName() const = 0; 451 virtual std::string GetDeviceName() const = 0;
443 452
444 // Implements platform specific operations to initiate a GATT connection. 453 // Implements platform specific operations to initiate a GATT connection.
445 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or 454 // Subclasses must also call DidConnectGatt, DidFailToConnectGatt, or
446 // DidDisconnectGatt immediately or asynchronously as the connection state 455 // DidDisconnectGatt immediately or asynchronously as the connection state
447 // changes. 456 // changes.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 508
500 private: 509 private:
501 // Returns a localized string containing the device's bluetooth address and 510 // Returns a localized string containing the device's bluetooth address and
502 // a device type for display when |name_| is empty. 511 // a device type for display when |name_| is empty.
503 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 512 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
504 }; 513 };
505 514
506 } // namespace device 515 } // namespace device
507 516
508 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 517 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.cc ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698