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

Unified Diff: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h

Issue 491753002: [EasyUnlock] Add a private API for establishing an insecure Bluetooth connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-ChromeOS build Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h
diff --git a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h
index 9ed740691de7b71c79b1677ffebfcea52110e2a9..34da64bfaaa6af9b756f7bbeae597db0e676854c 100644
--- a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h
+++ b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h
@@ -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:
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698