Index: device/bluetooth/bluetooth_adapter_android.h |
diff --git a/device/bluetooth/bluetooth_adapter_android.h b/device/bluetooth/bluetooth_adapter_android.h |
index c2b662cfdca5b7c747aaf55f825dcb9cc7403dd0..7309e00308d97b30962b7053365d07fc5d8f0f7f 100644 |
--- a/device/bluetooth/bluetooth_adapter_android.h |
+++ b/device/bluetooth/bluetooth_adapter_android.h |
@@ -5,6 +5,7 @@ |
#ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
#define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
+#include "base/android/jni_android.h" |
#include "base/memory/weak_ptr.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
@@ -19,7 +20,14 @@ namespace device { |
class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final |
: public BluetoothAdapter { |
public: |
- static base::WeakPtr<BluetoothAdapter> CreateAdapter(); |
+ // Create a BluetoothAdapterAndroid instance. |
+ static base::WeakPtr<BluetoothAdapterAndroid> CreateAdapter(); |
armansito
2015/05/06 01:57:06
Shouldn't this be <BluetoothAdapter>?
scheib
2015/05/06 04:30:15
No, changed to BluetoothAdapterAndroid so that And
|
+ |
+ // Register C++ methods exposed to Java using JNI. |
+ static bool RegisterJNI(JNIEnv* env); |
+ |
+ // True if this app has android permissions necessary for bluetooth. |
armansito
2015/05/06 01:57:06
s/bluetooth/Bluetooth/
scheib
2015/05/06 04:30:15
Done.
|
+ bool has_bluetooth_permission() { return has_bluetooth_permission_; } |
armansito
2015/05/06 01:57:06
nit: make this a const method.
scheib
2015/05/06 04:30:15
Done.
|
// BluetoothAdapter: |
std::string GetAddress() const override; |
@@ -74,6 +82,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final |
void RemovePairingDelegateInternal( |
BluetoothDevice::PairingDelegate* pairing_delegate) override; |
+ // Java object org.chromium.device.bluetooth.BluetoothAdapter. |
+ base::android::ScopedJavaGlobalRef<jobject> j_bluetooth_adapter_; |
+ |
+ bool has_bluetooth_permission_ = false; |
armansito
2015/05/06 01:57:06
Is this allowed in Chromium (or C++ for that matte
scheib
2015/05/06 04:30:15
Yes, https://chromium-cpp.appspot.com/ "Non-Static
|
std::string address_; |
std::string name_; |