Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 const CreateServiceErrorCallback& error_callback) override; | 75 const CreateServiceErrorCallback& error_callback) override; |
| 76 void RegisterAudioSink( | 76 void RegisterAudioSink( |
| 77 const BluetoothAudioSink::Options& options, | 77 const BluetoothAudioSink::Options& options, |
| 78 const AcquiredCallback& callback, | 78 const AcquiredCallback& callback, |
| 79 const BluetoothAudioSink::ErrorCallback& error_callback) override; | 79 const BluetoothAudioSink::ErrorCallback& error_callback) override; |
| 80 void RegisterAdvertisement( | 80 void RegisterAdvertisement( |
| 81 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, | 81 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
| 82 const CreateAdvertisementCallback& callback, | 82 const CreateAdvertisementCallback& callback, |
| 83 const CreateAdvertisementErrorCallback& error_callback) override; | 83 const CreateAdvertisementErrorCallback& error_callback) override; |
| 84 | 84 |
| 85 // Returns BluetoothAdapter Observers for platform specific classes to use | |
| 86 // to send event notifications. | |
| 87 base::ObserverList<device::BluetoothAdapter::Observer>& GetObservers() { | |
|
ortuno
2015/10/08 22:53:27
Why is this not bluetooth_adapter.h/cc?
scheib
2015/10/08 23:52:19
Explained in comment.
| |
| 88 return observers_; | |
| 89 } | |
| 90 | |
| 85 // Handles a scan error event by invalidating all discovery sessions. | 91 // Handles a scan error event by invalidating all discovery sessions. |
| 86 void OnScanFailed(JNIEnv* env, jobject caller); | 92 void OnScanFailed(JNIEnv* env, jobject caller); |
| 87 | 93 |
| 88 // Creates or updates device with advertised UUID information when a device is | 94 // Creates or updates device with advertised UUID information when a device is |
| 89 // discovered during a scan. | 95 // discovered during a scan. |
| 90 void CreateOrUpdateDeviceOnScan( | 96 void CreateOrUpdateDeviceOnScan( |
| 91 JNIEnv* env, | 97 JNIEnv* env, |
| 92 jobject caller, | 98 jobject caller, |
| 93 const jstring& address, | 99 const jstring& address, |
| 94 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper | 100 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 120 // Note: This should remain the last member so it'll be destroyed and | 126 // Note: This should remain the last member so it'll be destroyed and |
| 121 // invalidate its weak pointers before any other members are destroyed. | 127 // invalidate its weak pointers before any other members are destroyed. |
| 122 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; | 128 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; |
| 123 | 129 |
| 124 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); | 130 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); |
| 125 }; | 131 }; |
| 126 | 132 |
| 127 } // namespace device | 133 } // namespace device |
| 128 | 134 |
| 129 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 135 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
| OLD | NEW |