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/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 static base::WeakPtr<BluetoothAdapterAndroid> CreateAdapter(); | 24 static base::WeakPtr<BluetoothAdapterAndroid> CreateAdapter(); |
25 | 25 |
26 // Create a BluetoothAdapterAndroid instance without Bluetooth permission. | 26 // Create a BluetoothAdapterAndroid instance without Bluetooth permission. |
27 static base::WeakPtr<BluetoothAdapterAndroid> | 27 static base::WeakPtr<BluetoothAdapterAndroid> |
28 CreateAdapterWithoutPermissionForTesting(); | 28 CreateAdapterWithoutPermissionForTesting(); |
29 | 29 |
30 // Register C++ methods exposed to Java using JNI. | 30 // Register C++ methods exposed to Java using JNI. |
31 static bool RegisterJNI(JNIEnv* env); | 31 static bool RegisterJNI(JNIEnv* env); |
32 | 32 |
33 // True if this app has android permissions necessary for Bluetooth. | 33 // True if this app has android permissions necessary for Bluetooth. |
34 bool HasBluetoothPermission() const; | 34 bool HasBluetoothCapability() const; |
35 | 35 |
36 // BluetoothAdapter: | 36 // BluetoothAdapter: |
37 std::string GetAddress() const override; | 37 std::string GetAddress() const override; |
38 std::string GetName() const override; | 38 std::string GetName() const override; |
39 void SetName(const std::string& name, | 39 void SetName(const std::string& name, |
40 const base::Closure& callback, | 40 const base::Closure& callback, |
41 const ErrorCallback& error_callback) override; | 41 const ErrorCallback& error_callback) override; |
42 bool IsInitialized() const override; | 42 bool IsInitialized() const override; |
43 bool IsPresent() const override; | 43 bool IsPresent() const override; |
44 bool IsPowered() const override; | 44 bool IsPowered() const override; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Note: This should remain the last member so it'll be destroyed and | 95 // Note: This should remain the last member so it'll be destroyed and |
96 // invalidate its weak pointers before any other members are destroyed. | 96 // invalidate its weak pointers before any other members are destroyed. |
97 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; | 97 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); | 99 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace device | 102 } // namespace device |
103 | 103 |
104 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 104 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
OLD | NEW |