OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual ~BluetoothGetAdapterStateFunction() {} | 120 virtual ~BluetoothGetAdapterStateFunction() {} |
121 | 121 |
122 // BluetoothExtensionFunction: | 122 // BluetoothExtensionFunction: |
123 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 123 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; |
124 }; | 124 }; |
125 | 125 |
126 class BluetoothGetDevicesFunction : public BluetoothExtensionFunction { | 126 class BluetoothGetDevicesFunction : public BluetoothExtensionFunction { |
127 public: | 127 public: |
128 DECLARE_EXTENSION_FUNCTION("bluetooth.getDevices", BLUETOOTH_GETDEVICES) | 128 DECLARE_EXTENSION_FUNCTION("bluetooth.getDevices", BLUETOOTH_GETDEVICES) |
129 | 129 |
130 BluetoothGetDevicesFunction(); | |
131 | |
132 protected: | 130 protected: |
133 virtual ~BluetoothGetDevicesFunction() {} | 131 virtual ~BluetoothGetDevicesFunction() {} |
134 | 132 |
135 // BluetoothExtensionFunction: | 133 // BluetoothExtensionFunction: |
136 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 134 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; |
137 | |
138 private: | |
139 void DispatchDeviceSearchResult(const device::BluetoothDevice& device); | |
140 void FinishDeviceSearch(); | |
141 | |
142 int device_events_sent_; | |
143 }; | 135 }; |
144 | 136 |
145 class BluetoothGetServicesFunction : public BluetoothExtensionFunction { | 137 class BluetoothGetServicesFunction : public BluetoothExtensionFunction { |
146 public: | 138 public: |
147 DECLARE_EXTENSION_FUNCTION("bluetooth.getServices", BLUETOOTH_GETSERVICES) | 139 DECLARE_EXTENSION_FUNCTION("bluetooth.getServices", BLUETOOTH_GETSERVICES) |
148 | 140 |
149 protected: | 141 protected: |
150 virtual ~BluetoothGetServicesFunction() {} | 142 virtual ~BluetoothGetServicesFunction() {} |
151 | 143 |
152 // BluetoothExtensionFunction: | 144 // BluetoothExtensionFunction: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 275 |
284 private: | 276 private: |
285 void OnSuccessCallback(); | 277 void OnSuccessCallback(); |
286 void OnErrorCallback(); | 278 void OnErrorCallback(); |
287 }; | 279 }; |
288 | 280 |
289 } // namespace api | 281 } // namespace api |
290 } // namespace extensions | 282 } // namespace extensions |
291 | 283 |
292 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 284 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
OLD | NEW |