OLD | NEW |
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_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R
OUTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R
OUTER_H_ |
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R
OUTER_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R
OUTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 device::BluetoothAdapter* adapter, | 261 device::BluetoothAdapter* adapter, |
262 device::BluetoothGattDescriptor* descriptor) override; | 262 device::BluetoothGattDescriptor* descriptor) override; |
263 void GattCharacteristicValueChanged( | 263 void GattCharacteristicValueChanged( |
264 device::BluetoothAdapter* adapter, | 264 device::BluetoothAdapter* adapter, |
265 device::BluetoothGattCharacteristic* characteristic, | 265 device::BluetoothGattCharacteristic* characteristic, |
266 const std::vector<uint8>& value) override; | 266 const std::vector<uint8>& value) override; |
267 void GattDescriptorValueChanged(device::BluetoothAdapter* adapter, | 267 void GattDescriptorValueChanged(device::BluetoothAdapter* adapter, |
268 device::BluetoothGattDescriptor* descriptor, | 268 device::BluetoothGattDescriptor* descriptor, |
269 const std::vector<uint8>& value) override; | 269 const std::vector<uint8>& value) override; |
270 | 270 |
| 271 device::BluetoothAdapter* adapter() { return adapter_.get(); } |
| 272 |
271 private: | 273 private: |
272 // Called by BluetoothAdapterFactory. | 274 // Called by BluetoothAdapterFactory. |
273 void OnGetAdapter(const base::Closure& callback, | 275 void OnGetAdapter(const base::Closure& callback, |
274 scoped_refptr<device::BluetoothAdapter> adapter); | 276 scoped_refptr<device::BluetoothAdapter> adapter); |
275 | 277 |
276 // Initializes the identifier for all existing GATT objects and devices. | 278 // Initializes the identifier for all existing GATT objects and devices. |
277 // Called by OnGetAdapter and SetAdapterForTesting. | 279 // Called by OnGetAdapter and SetAdapterForTesting. |
278 void InitializeIdentifierMappings(); | 280 void InitializeIdentifierMappings(); |
279 | 281 |
280 // Sends the event named |event_name| to all listeners of that event that | 282 // Sends the event named |event_name| to all listeners of that event that |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // Note: This should remain the last member so it'll be destroyed and | 420 // Note: This should remain the last member so it'll be destroyed and |
419 // invalidate its weak pointers before any other members are destroyed. | 421 // invalidate its weak pointers before any other members are destroyed. |
420 base::WeakPtrFactory<BluetoothLowEnergyEventRouter> weak_ptr_factory_; | 422 base::WeakPtrFactory<BluetoothLowEnergyEventRouter> weak_ptr_factory_; |
421 | 423 |
422 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyEventRouter); | 424 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyEventRouter); |
423 }; | 425 }; |
424 | 426 |
425 } // namespace extensions | 427 } // namespace extensions |
426 | 428 |
427 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVEN
T_ROUTER_H_ | 429 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVEN
T_ROUTER_H_ |
OLD | NEW |