Descriptionbluetooth: implement device pairing support
Add BluetoothAdapter::GetDevice() so that the options handler can
retrieve a BluetoothDevice* for an address that it receives from
JavaScript, so it doesn't have to cache structures by itself.
Include a reference to the owning BluetoothAdapter* in BluetoothDevice
since the underlying CreateDevice and CreatePairedDevice method calls
are actually made on adapter clients, and need its object path. Make
BluetoothDevice a friend of BluetoothAdapter so it can retrieve that
object path (we don't want anything D-Bussy in the public API).
BluetoothDevice gains a BluetoothAgentServiceProvider member which is
set during pairing, and implements BluetoothAgentServiceProvider::Delegate
to receive the method calls passing them on to BluetoothOptionsHandler
via the BluetoothDevice::PairingDelegate interface it implements.
Rather than require the options handler to deal with callbacks, cache the
service provider callbacks within BluetoothDevice so that replies are done
with ordinary method calls asynchronously.
Use a weak pointer factory in BluetoothOptionsHandler in case error callbacks
are called after destruction. Declare constants for strings between the C++
code and JavaScript at the top, rather than inline.
Clean up JavaScript code to disambiguate "connect" vs. "accept" and
"cancel" vs. "reject".
BUG=chromium-os:21320
TEST=extensively on device
Change-Id: I941ca42f676e7a6e557c657b6213a74429eb4376
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=126713
Patch Set 1 #
Total comments: 2
Patch Set 2 : add closeOverlay() to reject button #
Total comments: 4
Patch Set 3 : address jhawkins' nits #Patch Set 4 : [clang] add missing OVERRIDE #Patch Set 5 : [clang] use POD for constants to avoid exit-time destructor error #
Total comments: 4
Messages
Total messages: 10 (0 generated)
|