diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 09:25:29 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 09:25:29 +0000 |
commit | 284773982716ed62182f1b1c1897d0c33d165bda (patch) | |
tree | 4d3c5d5b471c8e89b25c9eb40dc9063e3fd78e56 /chrome/browser/chromeos/bluetooth | |
parent | dd6bfdea5eb77fcbbd8e651b0e1c534e3a407f0e (diff) | |
download | chromium_src-284773982716ed62182f1b1c1897d0c33d165bda.zip chromium_src-284773982716ed62182f1b1c1897d0c33d165bda.tar.gz chromium_src-284773982716ed62182f1b1c1897d0c33d165bda.tar.bz2 |
Revert 142360 - Add additional device attributes.
TEST=updated apitest
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10537167
TBR=bryeung@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10539180
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/bluetooth')
4 files changed, 7 insertions, 30 deletions
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc index 6e5d1dae..3c2e120 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc +++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc @@ -194,10 +194,6 @@ string16 BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() const { } } -bool BluetoothDevice::IsPaired() const { return !object_path_.value().empty(); } - -bool BluetoothDevice::IsBonded() const { return bonded_; } - bool BluetoothDevice::IsConnected() const { // TODO(keybuk): examine protocol-specific connected state, such as Input return connected_; diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.h b/chrome/browser/chromeos/bluetooth/bluetooth_device.h index 06514c0..2c3a240 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_device.h +++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.h @@ -161,16 +161,16 @@ class BluetoothDevice : private BluetoothDeviceClient::Observer, // Indicates whether the device is paired to the adapter, whether or not // that pairing is permanent or temporary. - virtual bool IsPaired() const; + bool IsPaired() const { return !object_path_.value().empty(); } // Indicates whether the device is bonded to the adapter, bonding is // formed by pairing and exchanging high-security link keys so that // connections may be encrypted. - virtual bool IsBonded() const; + bool IsBonded() const { return bonded_; } // Indicates whether the device is currently connected to the adapter // and at least one service available for use. - virtual bool IsConnected() const; + bool IsConnected() const; // Returns the services (as UUID strings) that this device provides. typedef std::vector<std::string> ServiceList; diff --git a/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.cc index 5bc0cf7..c09ccd98 100644 --- a/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.cc +++ b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.cc @@ -9,24 +9,12 @@ namespace chromeos { MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, - const std::string& name, - const std::string& address, - bool paired, - bool bonded, - bool connected) - : BluetoothDevice(adapter), - name_(UTF8ToUTF16(name)), - address_(address) { + const std::string& name, const std::string& address) + : BluetoothDevice(adapter), name_(UTF8ToUTF16(name)), address_(address) { ON_CALL(*this, GetName()) .WillByDefault(testing::Return(name_)); ON_CALL(*this, address()) .WillByDefault(testing::ReturnRef(address_)); - ON_CALL(*this, IsPaired()) - .WillByDefault(testing::Return(paired)); - ON_CALL(*this, IsBonded()) - .WillByDefault(testing::Return(bonded)); - ON_CALL(*this, IsConnected()) - .WillByDefault(testing::Return(connected)); } MockBluetoothDevice::~MockBluetoothDevice() {} diff --git a/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h index c7b9226..f2d204f 100644 --- a/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h +++ b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h @@ -16,19 +16,12 @@ namespace chromeos { class MockBluetoothDevice : public BluetoothDevice { public: - MockBluetoothDevice(MockBluetoothAdapter* adapter, - const std::string& name, - const std::string& address, - bool paired, - bool bonded, - bool connected); + explicit MockBluetoothDevice(MockBluetoothAdapter* adapter, + const std::string& name, const std::string& address); virtual ~MockBluetoothDevice(); MOCK_CONST_METHOD0(address, const std::string&()); MOCK_CONST_METHOD0(GetName, string16()); - MOCK_CONST_METHOD0(IsPaired, bool()); - MOCK_CONST_METHOD0(IsBonded, bool()); - MOCK_CONST_METHOD0(IsConnected, bool()); MOCK_CONST_METHOD1(ProvidesServiceWithUUID, bool(const std::string&)); MOCK_METHOD3(SetOutOfBandPairingData, |