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

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed)

Created:
7 years, 8 months ago by keybuk
Modified:
7 years, 8 months ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, sadrul, nkostylev+watch_chromium.org, ben+watch_chromium.org, yoshiki+watch_chromium.org, sail+watch_chromium.org, Aaron Boodman, arv+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Bluetooth: clean up Bluetooth classes The abstract BluetoothDevice class has a few problems inherited from its origin as a ChromeOS-specific class split between implementation and platform-specific components. Clean those problems up, specifically: - replace bluetooth_class_, name_ and address_ non-abstract members with getter functions that the platform should implement. - also make IsConnected(), IsConnectable() and IsConnecting() abstract functions rather than providing an implementation - remove IsVisible() which was a CrOS-specific hack - remove IsBonded(), use IsPaired() instead - remove service_uuids_ non-abstract member; make GetServices return a copy of the list to allow implementations to fetch it on demand BluetoothDevice retains implementations for GetName(), GetDisplayType() and ProvidesServiceWithUUID() since those can be implemented entirely using platform-provided information functions and would be identical in each platform. Also rename BluetoothAdapter::address() and BluetoothAdapter::name() to GetAddress() and GetName() to match since they are also pure virtual. BUG=none TEST=device_unittests, browser_tests, unit_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192474

Patch Set 1 #

Patch Set 2 : s/:/;/ #

Patch Set 3 : Make GetServices return a copy of the list #

Total comments: 8

Patch Set 4 : address -> GetAddress, name -> GetDeviceName(), bluetooth_class -> GetBluetoothClass() #

Patch Set 5 : Keep the internal SetVisible()/visible state in Windows so Change signals can be sent when discover… #

Patch Set 6 : More win visible fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+344 lines, -230 lines) Patch
M ash/system/bluetooth/tray_bluetooth.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/system_tray_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/system/ash_system_tray_delegate.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_api_utils.cc View 1 2 3 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc View 1 2 3 9 chunks +18 lines, -18 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/resources/chromeos/browser_options.js View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/options/browser_options.js View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/options/chromeos/bluetooth_device_list.js View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/resources/options/chromeos/bluetooth_pair_device_overlay.js View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc View 1 2 3 4 chunks +5 lines, -6 lines 0 comments Download
M chrome/common/extensions/api/bluetooth.idl View 2 chunks +1 line, -6 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.h View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.cc View 1 2 3 6 chunks +17 lines, -15 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos_unittest.cc View 1 2 3 6 chunks +6 lines, -6 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc View 2 chunks +1 line, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_experimental_chromeos.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_experimental_chromeos.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.mm View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_device.h View 1 2 3 5 chunks +14 lines, -46 lines 0 comments Download
M device/bluetooth/bluetooth_device.cc View 1 2 3 5 chunks +27 lines, -53 lines 0 comments Download
M device/bluetooth/bluetooth_device_chromeos.h View 1 2 3 3 chunks +47 lines, -6 lines 0 comments Download
M device/bluetooth/bluetooth_device_chromeos.cc View 1 2 3 7 chunks +36 lines, -9 lines 0 comments Download
M device/bluetooth/bluetooth_device_mac.h View 1 2 3 3 chunks +28 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_device_mac.mm View 1 2 3 2 chunks +27 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_device_win.h View 1 2 3 4 5 3 chunks +36 lines, -3 lines 0 comments Download
M device/bluetooth/bluetooth_device_win.cc View 1 2 3 4 5 2 chunks +27 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_device_win_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/test/mock_bluetooth_adapter.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_device.h View 1 2 3 2 chunks +9 lines, -5 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_device.cc View 1 2 3 2 chunks +15 lines, -8 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
keybuk
youngki: for device/ OWNERS jennyz: for ash/system/ OWNERS stevenjb: for chrome/browser/chromeos/ OWNERS miket: for chrome/browser/extensions/ ...
7 years, 8 months ago (2013-04-03 21:41:55 UTC) #1
youngki
https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 device/bluetooth/bluetooth_device.h:155: virtual uint32 bluetooth_class() const = 0; Should we make ...
7 years, 8 months ago (2013-04-03 22:17:17 UTC) #2
keybuk
https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 device/bluetooth/bluetooth_device.h:155: virtual uint32 bluetooth_class() const = 0; On 2013/04/03 22:17:17, ...
7 years, 8 months ago (2013-04-03 22:18:55 UTC) #3
stevenjb
https://codereview.chromium.org/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://codereview.chromium.org/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 device/bluetooth/bluetooth_device.h:155: virtual uint32 bluetooth_class() const = 0; On 2013/04/03 22:18:56, ...
7 years, 8 months ago (2013-04-03 23:04:57 UTC) #4
keybuk
On 2013/04/03 23:04:57, stevenjb (chromium) wrote: > https://codereview.chromium.org/13416005/diff/6001/device/bluetooth/bluetooth_device.h > File device/bluetooth/bluetooth_device.h (right): > > https://codereview.chromium.org/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 ...
7 years, 8 months ago (2013-04-04 00:43:41 UTC) #5
stevenjb
lgtm https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 device/bluetooth/bluetooth_device.h:155: virtual uint32 bluetooth_class() const = 0; On 2013/04/03 ...
7 years, 8 months ago (2013-04-04 00:47:30 UTC) #6
stevenjb
On 2013/04/04 00:47:30, stevenjb (chromium) wrote: > lgtm > > https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h > File device/bluetooth/bluetooth_device.h (right): ...
7 years, 8 months ago (2013-04-04 00:48:36 UTC) #7
keybuk
https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode155 device/bluetooth/bluetooth_device.h:155: virtual uint32 bluetooth_class() const = 0; On 2013/04/04 00:47:31, ...
7 years, 8 months ago (2013-04-04 01:18:06 UTC) #8
youngki
lgtm https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h File device/bluetooth/bluetooth_device.h (right): https://chromiumcodereview.appspot.com/13416005/diff/6001/device/bluetooth/bluetooth_device.h#newcode193 device/bluetooth/bluetooth_device.h:193: virtual ServiceList GetServices() const = 0; On 2013/04/03 ...
7 years, 8 months ago (2013-04-04 12:59:08 UTC) #9
stevenjb
LGTM
7 years, 8 months ago (2013-04-04 16:10:47 UTC) #10
youngki
lgtm
7 years, 8 months ago (2013-04-04 19:59:11 UTC) #11
miket_OOO
> miket: for chrome/browser/extensions/ OWNERS LGTM
7 years, 8 months ago (2013-04-04 21:36:41 UTC) #12
James Hawkins
resources/ LGTM I suggest breaking up such a large CL in the future.
7 years, 8 months ago (2013-04-04 21:37:08 UTC) #13
Rick Byers
On 2013/04/04 21:37:08, James Hawkins wrote: > resources/ LGTM > > I suggest breaking up ...
7 years, 8 months ago (2013-04-04 22:04:25 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/keybuk@chromium.org/13416005/50001
7 years, 8 months ago (2013-04-04 22:05:44 UTC) #15
commit-bot: I haz the power
Change committed as 192474
7 years, 8 months ago (2013-04-05 03:32:29 UTC) #16
Nikita (slow)
7 years, 8 months ago (2013-04-05 10:34:33 UTC) #17
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698