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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_private_api.h

Issue 1419023004: Add bluetoothPrivate.connect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_543294_bluetooth_options_2b_props
Patch Set: Rebase Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h"
9 #include "device/bluetooth/bluetooth_device.h" 10 #include "device/bluetooth/bluetooth_device.h"
10 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" 11 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h"
11 #include "extensions/browser/browser_context_keyed_api_factory.h" 12 #include "extensions/browser/browser_context_keyed_api_factory.h"
12 #include "extensions/browser/event_router.h" 13 #include "extensions/browser/event_router.h"
13 14
14 namespace device { 15 namespace device {
15 class BluetoothAdapter; 16 class BluetoothAdapter;
16 } 17 }
17 18
18 namespace extensions { 19 namespace extensions {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ~BluetoothPrivateSetDiscoveryFilterFunction() override {} 122 ~BluetoothPrivateSetDiscoveryFilterFunction() override {}
122 123
123 // BluetoothExtensionFunction: 124 // BluetoothExtensionFunction:
124 bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; 125 bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;
125 126
126 private: 127 private:
127 void OnSuccessCallback(); 128 void OnSuccessCallback();
128 void OnErrorCallback(); 129 void OnErrorCallback();
129 }; 130 };
130 131
132 class BluetoothPrivateConnectFunction : public BluetoothExtensionFunction {
133 public:
134 DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.connect",
135 BLUETOOTHPRIVATE_CONNECT)
136 BluetoothPrivateConnectFunction();
137
138 // BluetoothExtensionFunction:
139 bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;
140
141 private:
142 ~BluetoothPrivateConnectFunction() override;
143
144 void OnSuccessCallback();
145 void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error);
146
147 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateConnectFunction);
148 };
149
131 class BluetoothPrivatePairFunction : public BluetoothExtensionFunction { 150 class BluetoothPrivatePairFunction : public BluetoothExtensionFunction {
132 public: 151 public:
133 DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.pair", BLUETOOTHPRIVATE_PAIR) 152 DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.pair", BLUETOOTHPRIVATE_PAIR)
134 BluetoothPrivatePairFunction(); 153 BluetoothPrivatePairFunction();
135 154
136 // BluetoothExtensionFunction: 155 // BluetoothExtensionFunction:
137 bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; 156 bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;
138 157
139 private: 158 private:
140 ~BluetoothPrivatePairFunction() override; 159 ~BluetoothPrivatePairFunction() override;
141 160
142 void OnSuccessCallback(); 161 void OnSuccessCallback();
143 void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error); 162 void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error);
144 163
145 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivatePairFunction); 164 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivatePairFunction);
146 }; 165 };
147 166
148 } // namespace api 167 } // namespace api
149 168
150 } // namespace extensions 169 } // namespace extensions
151 170
152 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ 171 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698