Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Issue 9694054: bluetooth: implement device pairing support (Closed)

Created:
8 years, 9 months ago by keybuk
Modified:
8 years, 9 months ago
CC:
chromium-reviews, arv (Not doing code reviews), stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org, bryeung
Visibility:
Public.

Description

bluetooth: 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+705 lines, -101 lines) Patch
M chrome/browser/chromeos/bluetooth/bluetooth_adapter.h View 3 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc View 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/bluetooth/bluetooth_device.h View 1 2 3 6 chunks +269 lines, -7 lines 2 comments Download
M chrome/browser/chromeos/bluetooth/bluetooth_device.cc View 3 chunks +238 lines, -5 lines 2 comments Download
M chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js View 1 2 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.h View 1 2 4 chunks +76 lines, -40 lines 0 comments Download
M chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc View 1 2 3 4 4 chunks +90 lines, -37 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
keybuk
satorux for dbus/ and bluetooth/ jhawkins for options2 kevers for JS sanity checks
8 years, 9 months ago (2012-03-13 22:30:52 UTC) #1
kevers
https://chromiumcodereview.appspot.com/9694054/diff/1/chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js File chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js (right): https://chromiumcodereview.appspot.com/9694054/diff/1/chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js#newcode83 chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js:83: }; missing closeOverlay on the reject click?
8 years, 9 months ago (2012-03-13 22:57:20 UTC) #2
keybuk
https://chromiumcodereview.appspot.com/9694054/diff/1/chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js File chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js (right): https://chromiumcodereview.appspot.com/9694054/diff/1/chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js#newcode83 chrome/browser/resources/options2/chromeos/bluetooth_pair_device_overlay.js:83: }; On 2012/03/13 22:57:20, kevers wrote: > missing closeOverlay ...
8 years, 9 months ago (2012-03-13 22:59:43 UTC) #3
kevers
Looks good to me.
8 years, 9 months ago (2012-03-13 23:07:10 UTC) #4
James Hawkins
LGTM with nits. https://chromiumcodereview.appspot.com/9694054/diff/3001/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc File chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc (right): https://chromiumcodereview.appspot.com/9694054/diff/3001/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc#newcode256 chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc:256: nit: Remove blank line. Here and ...
8 years, 9 months ago (2012-03-13 23:12:45 UTC) #5
keybuk
https://chromiumcodereview.appspot.com/9694054/diff/3001/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc File chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc (right): https://chromiumcodereview.appspot.com/9694054/diff/3001/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc#newcode256 chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc:256: On 2012/03/13 23:12:45, James Hawkins wrote: > nit: Remove ...
8 years, 9 months ago (2012-03-14 00:15:26 UTC) #6
satorux1
LGTM with nits: http://codereview.chromium.org/9694054/diff/5004/chrome/browser/chromeos/bluetooth/bluetooth_device.cc File chrome/browser/chromeos/bluetooth/bluetooth_device.cc (right): http://codereview.chromium.org/9694054/diff/5004/chrome/browser/chromeos/bluetooth/bluetooth_device.cc#newcode226 chrome/browser/chromeos/bluetooth/bluetooth_device.cc:226: pincode_callback_.Run(SUCCESS, pincode); Would it be possible ...
8 years, 9 months ago (2012-03-14 16:55:56 UTC) #7
keybuk
http://codereview.chromium.org/9694054/diff/5004/chrome/browser/chromeos/bluetooth/bluetooth_device.cc File chrome/browser/chromeos/bluetooth/bluetooth_device.cc (right): http://codereview.chromium.org/9694054/diff/5004/chrome/browser/chromeos/bluetooth/bluetooth_device.cc#newcode226 chrome/browser/chromeos/bluetooth/bluetooth_device.cc:226: pincode_callback_.Run(SUCCESS, pincode); No, RequestPinCode() is private precisely to prevent ...
8 years, 9 months ago (2012-03-14 18:07:55 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/keybuk@chromium.org/9694054/5004
8 years, 9 months ago (2012-03-14 18:13:57 UTC) #9
commit-bot: I haz the power
8 years, 9 months ago (2012-03-14 20:03:11 UTC) #10
Change committed as 126713

Powered by Google App Engine
This is Rietveld 408576698