Upstream version 10.38.208.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / bluetooth_socket / bluetooth_socket_api.h
index 9ed7406..34da64b 100644 (file)
@@ -208,29 +208,49 @@ class BluetoothSocketListenUsingL2capFunction
   scoped_ptr<bluetooth_socket::ListenUsingL2cap::Params> params_;
 };
 
-class BluetoothSocketConnectFunction : public BluetoothSocketAsyncApiFunction {
+class BluetoothSocketAbstractConnectFunction :
+    public BluetoothSocketAsyncApiFunction {
  public:
-  DECLARE_EXTENSION_FUNCTION("bluetoothSocket.connect",
-                             BLUETOOTHSOCKET_CONNECT);
-
-  BluetoothSocketConnectFunction();
+  BluetoothSocketAbstractConnectFunction();
 
  protected:
-  virtual ~BluetoothSocketConnectFunction();
+  virtual ~BluetoothSocketAbstractConnectFunction();
 
   // BluetoothSocketAsyncApiFunction:
   virtual bool Prepare() OVERRIDE;
   virtual void AsyncWorkStart() OVERRIDE;
 
- private:
-  virtual void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
+  // Subclasses should implement this method to connect to the service
+  // registered with |uuid| on the |device|.
+  virtual void ConnectToService(device::BluetoothDevice* device,
+                                const device::BluetoothUUID& uuid) = 0;
+
   virtual void OnConnect(scoped_refptr<device::BluetoothSocket> socket);
   virtual void OnConnectError(const std::string& message);
 
+ private:
+  virtual void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
+
   scoped_ptr<bluetooth_socket::Connect::Params> params_;
   BluetoothSocketEventDispatcher* socket_event_dispatcher_;
 };
 
+class BluetoothSocketConnectFunction :
+    public BluetoothSocketAbstractConnectFunction {
+ public:
+  DECLARE_EXTENSION_FUNCTION("bluetoothSocket.connect",
+                             BLUETOOTHSOCKET_CONNECT);
+
+  BluetoothSocketConnectFunction();
+
+ protected:
+  virtual ~BluetoothSocketConnectFunction();
+
+  // BluetoothSocketAbstractConnectFunction:
+  virtual void ConnectToService(device::BluetoothDevice* device,
+                                const device::BluetoothUUID& uuid) OVERRIDE;
+};
+
 class BluetoothSocketDisconnectFunction
     : public BluetoothSocketAsyncApiFunction {
  public: