0

Added BluetoothDeviceMac (empty implementation)

I added NOTIMPLEMENTED() to the methods which won't be supported in BluetoothDeviceMac.

BUG=135472


Review URL: https://chromiumcodereview.appspot.com/12660013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188894 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
youngki@chromium.org
2013-03-19 00:52:00 +00:00
parent 8c4b4db273
commit c579317dce
3 changed files with 174 additions and 0 deletions

@ -0,0 +1,62 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
#define DEVICE_BLUETOOTH_BlUETOOTH_DEVICE_MAC_H_
#include <string>
#include "base/basictypes.h"
#include "device/bluetooth/bluetooth_device.h"
namespace device {
class BluetoothDeviceMac : public BluetoothDevice {
public:
BluetoothDeviceMac();
virtual ~BluetoothDeviceMac();
// BluetoothDevice override
virtual bool IsPaired() const OVERRIDE;
virtual const ServiceList& GetServices() const OVERRIDE;
virtual void GetServiceRecords(
const ServiceRecordsCallback& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual void ProvidesServiceWithName(
const std::string& name,
const ProvidesServiceCallback& callback) OVERRIDE;
virtual bool ExpectingPinCode() const OVERRIDE;
virtual bool ExpectingPasskey() const OVERRIDE;
virtual bool ExpectingConfirmation() const OVERRIDE;
virtual void Connect(
PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) OVERRIDE;
virtual void SetPinCode(const std::string& pincode) OVERRIDE;
virtual void SetPasskey(uint32 passkey) OVERRIDE;
virtual void ConfirmPairing() OVERRIDE;
virtual void RejectPairing() OVERRIDE;
virtual void CancelPairing() OVERRIDE;
virtual void Disconnect(
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual void Forget(const ErrorCallback& error_callback) OVERRIDE;
virtual void ConnectToService(
const std::string& service_uuid,
const SocketCallback& callback) OVERRIDE;
virtual void SetOutOfBandPairingData(
const BluetoothOutOfBandPairingData& data,
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual void ClearOutOfBandPairingData(
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac);
};
} // namespace device
#endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_

@ -0,0 +1,110 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/bluetooth/bluetooth_device_mac.h"
#include <string>
#include "base/basictypes.h"
#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_service_record_mac.h"
namespace device {
BluetoothDeviceMac::BluetoothDeviceMac()
: BluetoothDevice() {
}
BluetoothDeviceMac::~BluetoothDeviceMac() {
}
bool BluetoothDeviceMac::IsPaired() const {
return false;
}
const BluetoothDevice::ServiceList& BluetoothDeviceMac::GetServices() const {
return service_uuids_;
}
void BluetoothDeviceMac::GetServiceRecords(
const ServiceRecordsCallback& callback,
const ErrorCallback& error_callback) {
}
void BluetoothDeviceMac::ProvidesServiceWithName(
const std::string& name,
const ProvidesServiceCallback& callback) {
}
bool BluetoothDeviceMac::ExpectingPinCode() const {
NOTIMPLEMENTED();
return false;
}
bool BluetoothDeviceMac::ExpectingPasskey() const {
NOTIMPLEMENTED();
return false;
}
bool BluetoothDeviceMac::ExpectingConfirmation() const {
NOTIMPLEMENTED();
return false;
}
void BluetoothDeviceMac::Connect(
PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::SetPinCode(const std::string& pincode) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::SetPasskey(uint32 passkey) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::ConfirmPairing() {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::RejectPairing() {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::CancelPairing() {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::Disconnect(
const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::Forget(const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::ConnectToService(
const std::string& service_uuid,
const SocketCallback& callback) {
}
void BluetoothDeviceMac::SetOutOfBandPairingData(
const BluetoothOutOfBandPairingData& data,
const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}
void BluetoothDeviceMac::ClearOutOfBandPairingData(
const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}
} // namespace device

@ -35,6 +35,8 @@
'bluetooth/bluetooth_device.h',
'bluetooth/bluetooth_device_chromeos.cc',
'bluetooth/bluetooth_device_chromeos.h',
'bluetooth/bluetooth_device_mac.h',
'bluetooth/bluetooth_device_mac.mm',
'bluetooth/bluetooth_device_win.cc',
'bluetooth/bluetooth_device_win.h',
'bluetooth/bluetooth_init_win.cc',