Chromium Code Reviews| Index: chrome/browser/extensions/api/bluetooth/bluetooth_api.h |
| diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h |
| index 0f57f27284bed835f72cb61a1c4bffa67ef2a4ee..c1540dbfe3c6c4688b642e15850956103e7b880a 100644 |
| --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h |
| +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h |
| @@ -7,21 +7,18 @@ |
| #include <string> |
| +#include "base/memory/ref_counted.h" |
| #include "chrome/browser/extensions/api/api_function.h" |
| #include "chrome/browser/extensions/extension_function.h" |
| +#include "device/bluetooth/bluetooth_device.h" |
| +#include "device/bluetooth/bluetooth_socket.h" |
| -#if defined(OS_CHROMEOS) |
| -#include "base/memory/ref_counted.h" |
| -#include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" |
| -#include "chrome/browser/chromeos/bluetooth/bluetooth_socket.h" |
| - |
| -namespace chromeos { |
| +namespace bluetooth { |
| class BluetoothSocket; |
|
bryeung
2012/10/11 15:15:39
please remove this (it's not needed, nor was it be
youngki
2012/10/11 16:21:18
BluetoothSocket is being used as a scoped_refptr i
|
| struct BluetoothOutOfBandPairingData; |
| -} // namespace chromeos |
| -#endif |
| +} // namespace bluetooth |
| namespace extensions { |
| namespace api { |
| @@ -74,9 +71,7 @@ class BluetoothGetDevicesFunction : public AsyncExtensionFunction { |
| public: |
| DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.getDevices") |
| -#if defined(OS_CHROMEOS) |
| BluetoothGetDevicesFunction(); |
| -#endif |
| protected: |
| virtual ~BluetoothGetDevicesFunction() {} |
| @@ -85,13 +80,11 @@ class BluetoothGetDevicesFunction : public AsyncExtensionFunction { |
| virtual bool RunImpl() OVERRIDE; |
| private: |
| -#if defined(OS_CHROMEOS) |
| - void DispatchDeviceSearchResult(const chromeos::BluetoothDevice& device); |
| - void ProvidesServiceCallback(const chromeos::BluetoothDevice* device, |
| + void DispatchDeviceSearchResult(const bluetooth::BluetoothDevice& device); |
| + void ProvidesServiceCallback(const bluetooth::BluetoothDevice* device, |
| bool providesService); |
| int callbacks_pending_; |
| -#endif |
| }; |
| class BluetoothGetServicesFunction : public AsyncExtensionFunction { |
| @@ -104,13 +97,11 @@ class BluetoothGetServicesFunction : public AsyncExtensionFunction { |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| -#if defined(OS_CHROMEOS) |
| private: |
| void GetServiceRecordsCallback( |
| base::ListValue* services, |
| - const chromeos::BluetoothDevice::ServiceRecordList& records); |
| + const bluetooth::BluetoothDevice::ServiceRecordList& records); |
| void OnErrorCallback(); |
| -#endif |
| }; |
| class BluetoothConnectFunction : public AsyncExtensionFunction { |
| @@ -123,12 +114,10 @@ class BluetoothConnectFunction : public AsyncExtensionFunction { |
| virtual bool RunImpl() OVERRIDE; |
| private: |
| -#if defined(OS_CHROMEOS) |
| void ConnectToServiceCallback( |
| - const chromeos::BluetoothDevice* device, |
| + const bluetooth::BluetoothDevice* device, |
| const std::string& service_uuid, |
| - scoped_refptr<chromeos::BluetoothSocket> socket); |
| -#endif |
| + scoped_refptr<bluetooth::BluetoothSocket> socket); |
| }; |
| class BluetoothDisconnectFunction : public SyncExtensionFunction { |
| @@ -156,10 +145,8 @@ class BluetoothReadFunction : public AsyncApiFunction { |
| virtual void Work() OVERRIDE; |
| private: |
| -#if defined(OS_CHROMEOS) |
| bool success_; |
| - scoped_refptr<chromeos::BluetoothSocket> socket_; |
| -#endif |
| + scoped_refptr<bluetooth::BluetoothSocket> socket_; |
| }; |
| class BluetoothWriteFunction : public AsyncApiFunction { |
| @@ -176,11 +163,9 @@ class BluetoothWriteFunction : public AsyncApiFunction { |
| virtual void Work() OVERRIDE; |
| private: |
| -#if defined(OS_CHROMEOS) |
| bool success_; |
| const base::BinaryValue* data_to_write_; // memory is owned by args_ |
| - scoped_refptr<chromeos::BluetoothSocket> socket_; |
| -#endif |
| + scoped_refptr<bluetooth::BluetoothSocket> socket_; |
| }; |
| class BluetoothSetOutOfBandPairingDataFunction |
| @@ -192,10 +177,8 @@ class BluetoothSetOutOfBandPairingDataFunction |
| protected: |
| virtual ~BluetoothSetOutOfBandPairingDataFunction() {} |
| -#if defined(OS_CHROMEOS) |
| void OnSuccessCallback(); |
| void OnErrorCallback(); |
| -#endif |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| @@ -210,10 +193,9 @@ class BluetoothGetLocalOutOfBandPairingDataFunction |
| protected: |
| virtual ~BluetoothGetLocalOutOfBandPairingDataFunction() {} |
| -#if defined(OS_CHROMEOS) |
| - void ReadCallback(const chromeos::BluetoothOutOfBandPairingData& data); |
| + void ReadCallback( |
| + const bluetooth::BluetoothOutOfBandPairingData& data); |
| void ErrorCallback(); |
| -#endif |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| @@ -229,11 +211,9 @@ class BluetoothStartDiscoveryFunction : public AsyncExtensionFunction { |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| -#if defined(OS_CHROMEOS) |
| private: |
| void OnSuccessCallback(); |
| void OnErrorCallback(); |
| -#endif |
| }; |
| class BluetoothStopDiscoveryFunction : public AsyncExtensionFunction { |
| @@ -246,11 +226,9 @@ class BluetoothStopDiscoveryFunction : public AsyncExtensionFunction { |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| -#if defined(OS_CHROMEOS) |
| private: |
| void OnSuccessCallback(); |
| void OnErrorCallback(); |
| -#endif |
| }; |
| } // namespace api |