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

Issue 2446823002: bluetooth: Componentize device list in chrome://bluetooth-internals. (Closed)

Created:
4 years, 1 month ago by mbrunson
Modified:
4 years, 1 month ago
Reviewers:
scheib, ortuno, Dan Beam, dpapad
CC:
arv+watch_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Componentize device list in chrome://bluetooth-internals. Separates device list HTML management code from device handling code. Adds DeviceTable for management of device table UI. Adds observable DeviceCollection for dynamic updates of DeviceTable. Adds AdapterBroker to handle adapter events and simplifier Adapter service communication. BUG=651282 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation TBR=dbeam@chromium.org Committed: https://crrev.com/d5d3edafbb53f7af22875e0c274d75bc1d84b430 Cr-Commit-Position: refs/heads/master@{#430458}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Separate device.js and bluetooth_internals.js #

Total comments: 2

Patch Set 3 : Simplify interfaces #

Patch Set 4 : Merge upstream, use importModules in util.js #

Patch Set 5 : Remove extra table #

Patch Set 6 : Add AdapterBroker, route AdapterClient events #

Patch Set 7 : Fix upstream #

Patch Set 8 : Clean up comments, HTML scripts #

Patch Set 9 : removeRow->deleteRow #

Total comments: 4

Patch Set 10 : Add adapter_broker module #

Patch Set 11 : Fix formatting #

Patch Set 12 : Clean up bluetooth_internals, formatting #

Patch Set 13 : Formatting changes, comments #

Total comments: 12

Patch Set 14 : Fix issues, add comments, move Adapter code to AdapterBroker #

Total comments: 8

Patch Set 15 : Rename functions, fix comments #

Total comments: 14

Patch Set 16 : Comments, exports, and CustomEvents #

Total comments: 12

Patch Set 17 : Add @private, fix comments #

Patch Set 18 : Change innerText to textContent in device table #

Total comments: 42
Unified diffs Side-by-side diffs Delta from patch set Stats (+487 lines, -136 lines) Patch
M chrome/browser/browser_resources.grd View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -2 lines 0 comments Download
A chrome/browser/resources/bluetooth_internals/adapter_broker.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +149 lines, -0 lines 15 comments Download
M chrome/browser/resources/bluetooth_internals/bluetooth_internals.html View 1 2 3 4 5 6 7 8 9 2 chunks +17 lines, -13 lines 2 comments Download
M chrome/browser/resources/bluetooth_internals/bluetooth_internals.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +35 lines, -121 lines 0 comments Download
A chrome/browser/resources/bluetooth_internals/device_collection.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +85 lines, -0 lines 2 comments Download
A chrome/browser/resources/bluetooth_internals/device_table.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +148 lines, -0 lines 17 comments Download
A chrome/browser/resources/bluetooth_internals/interfaces.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +39 lines, -0 lines 4 comments Download
M chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 2 comments Download

Dependent Patchsets:

Messages

Total messages: 56 (29 generated)
mbrunson
4 years, 1 month ago (2016-10-24 23:16:22 UTC) #3
ortuno
https://codereview.chromium.org/2446823002/diff/1/chrome/browser/resources/bluetooth_internals/device.js File chrome/browser/resources/bluetooth_internals/device.js (right): https://codereview.chromium.org/2446823002/diff/1/chrome/browser/resources/bluetooth_internals/device.js#newcode10 chrome/browser/resources/bluetooth_internals/device.js:10: cr.define('device', function() { Split the DeviceTable code into a ...
4 years, 1 month ago (2016-10-26 03:26:11 UTC) #4
scheib
Ping me if you'd like a review before you address ortuno's comments.
4 years, 1 month ago (2016-10-28 20:22:17 UTC) #5
mbrunson
https://codereview.chromium.org/2446823002/diff/1/chrome/browser/resources/bluetooth_internals/device.js File chrome/browser/resources/bluetooth_internals/device.js (right): https://codereview.chromium.org/2446823002/diff/1/chrome/browser/resources/bluetooth_internals/device.js#newcode10 chrome/browser/resources/bluetooth_internals/device.js:10: cr.define('device', function() { On 2016/10/26 03:26:11, ortuno wrote: > ...
4 years, 1 month ago (2016-10-29 00:49:43 UTC) #6
mbrunson
On 2016/10/28 20:22:17, scheib wrote: > Ping me if you'd like a review before you ...
4 years, 1 month ago (2016-10-29 00:51:30 UTC) #7
scheib
LGTM, but there's little value I add for the JS review. https://codereview.chromium.org/2446823002/diff/20001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): ...
4 years, 1 month ago (2016-10-31 20:24:36 UTC) #8
mbrunson
https://codereview.chromium.org/2446823002/diff/20001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2446823002/diff/20001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode10 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:10: cr.define('bluetooth_internals', function() { On 2016/10/31 20:24:36, scheib wrote: > ...
4 years, 1 month ago (2016-10-31 21:46:20 UTC) #9
mbrunson
OWNERS review for WebUI, please.
4 years, 1 month ago (2016-11-02 23:57:14 UTC) #11
ortuno
https://codereview.chromium.org/2446823002/diff/160001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2446823002/diff/160001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode110 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:110: adapterBroker = new AdapterBroker(adapter); Would it make sense to: ...
4 years, 1 month ago (2016-11-03 04:58:21 UTC) #15
mbrunson
https://codereview.chromium.org/2446823002/diff/160001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2446823002/diff/160001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode110 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:110: adapterBroker = new AdapterBroker(adapter); On 2016/11/03 04:58:21, ortuno wrote: ...
4 years, 1 month ago (2016-11-03 18:07:29 UTC) #16
ortuno
https://codereview.chromium.org/2446823002/diff/240001/chrome/browser/resources/bluetooth_internals/device_collection.js File chrome/browser/resources/bluetooth_internals/device_collection.js (right): https://codereview.chromium.org/2446823002/diff/240001/chrome/browser/resources/bluetooth_internals/device_collection.js#newcode54 chrome/browser/resources/bluetooth_internals/device_collection.js:54: this.push(device); nit: I would just do this.push(new Device(deviceInfo)); https://codereview.chromium.org/2446823002/diff/240001/chrome/browser/resources/bluetooth_internals/device_collection.js#newcode65 ...
4 years, 1 month ago (2016-11-03 22:14:15 UTC) #21
mbrunson
https://codereview.chromium.org/2446823002/diff/240001/chrome/browser/resources/bluetooth_internals/device_collection.js File chrome/browser/resources/bluetooth_internals/device_collection.js (right): https://codereview.chromium.org/2446823002/diff/240001/chrome/browser/resources/bluetooth_internals/device_collection.js#newcode54 chrome/browser/resources/bluetooth_internals/device_collection.js:54: this.push(device); On 2016/11/03 22:14:15, ortuno wrote: > nit: I ...
4 years, 1 month ago (2016-11-03 23:59:40 UTC) #24
ortuno
lgtm bar some better naming https://codereview.chromium.org/2446823002/diff/260001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2446823002/diff/260001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode42 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:42: initialize: initialize Maybe initializeViews ...
4 years, 1 month ago (2016-11-04 01:44:10 UTC) #25
mbrunson
https://codereview.chromium.org/2446823002/diff/260001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2446823002/diff/260001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode42 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:42: initialize: initialize On 2016/11/04 01:44:09, ortuno wrote: > Maybe ...
4 years, 1 month ago (2016-11-04 02:37:41 UTC) #26
mbrunson
WebUI OWNERS review, please.
4 years, 1 month ago (2016-11-04 02:38:30 UTC) #28
dpapad
+dbeam for device_table.js, which uses some WebUI infrastructure I am not familiar with. https://codereview.chromium.org/2446823002/diff/280001/chrome/browser/resources/bluetooth_internals/adapter_broker.js File ...
4 years, 1 month ago (2016-11-04 17:20:00 UTC) #30
mbrunson
https://codereview.chromium.org/2446823002/diff/280001/chrome/browser/resources/bluetooth_internals/adapter_broker.js File chrome/browser/resources/bluetooth_internals/adapter_broker.js (right): https://codereview.chromium.org/2446823002/diff/280001/chrome/browser/resources/bluetooth_internals/adapter_broker.js#newcode73 chrome/browser/resources/bluetooth_internals/adapter_broker.js:73: var event = new Event('deviceadded'); On 2016/11/04 17:19:59, dpapad ...
4 years, 1 month ago (2016-11-04 22:57:41 UTC) #31
dpapad
LGTM with nits. Please wait for @dbeam's approval too. https://codereview.chromium.org/2446823002/diff/280001/chrome/browser/resources/bluetooth_internals/device_collection.js File chrome/browser/resources/bluetooth_internals/device_collection.js (right): https://codereview.chromium.org/2446823002/diff/280001/chrome/browser/resources/bluetooth_internals/device_collection.js#newcode10 chrome/browser/resources/bluetooth_internals/device_collection.js:10: ...
4 years, 1 month ago (2016-11-04 23:43:52 UTC) #34
mbrunson
https://codereview.chromium.org/2446823002/diff/300001/chrome/browser/resources/bluetooth_internals/device_table.js File chrome/browser/resources/bluetooth_internals/device_table.js (right): https://codereview.chromium.org/2446823002/diff/300001/chrome/browser/resources/bluetooth_internals/device_table.js#newcode20 chrome/browser/resources/bluetooth_internals/device_table.js:20: this.devices_ = null; On 2016/11/04 23:43:52, dpapad wrote: > ...
4 years, 1 month ago (2016-11-07 20:22:43 UTC) #37
mbrunson
On 2016/11/04 23:43:52, dpapad wrote: > LGTM with nits. Please wait for @dbeam's approval too. ...
4 years, 1 month ago (2016-11-07 22:05:52 UTC) #40
dpapad
On 2016/11/07 22:05:52, mbrunson wrote: > On 2016/11/04 23:43:52, dpapad wrote: > > LGTM with ...
4 years, 1 month ago (2016-11-07 22:24:39 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2446823002/340001
4 years, 1 month ago (2016-11-08 00:06:59 UTC) #49
commit-bot: I haz the power
Committed patchset #18 (id:340001)
4 years, 1 month ago (2016-11-08 01:16:20 UTC) #51
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/d5d3edafbb53f7af22875e0c274d75bc1d84b430 Cr-Commit-Position: refs/heads/master@{#430458}
4 years, 1 month ago (2016-11-08 01:21:46 UTC) #53
Dan Beam
https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resources/bluetooth_internals/adapter_broker.js File chrome/browser/resources/bluetooth_internals/adapter_broker.js (right): https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resources/bluetooth_internals/adapter_broker.js#newcode40 chrome/browser/resources/bluetooth_internals/adapter_broker.js:40: * @return {Array<interfaces.BluetoothDevice.DeviceInfo>} can we add more !, i.e. ...
4 years, 1 month ago (2016-11-09 18:00:32 UTC) #54
mbrunson
CL fixes implemented here: https://codereview.chromium.org/2488093003/ https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resources/bluetooth_internals/adapter_broker.js File chrome/browser/resources/bluetooth_internals/adapter_broker.js (right): https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resources/bluetooth_internals/adapter_broker.js#newcode40 chrome/browser/resources/bluetooth_internals/adapter_broker.js:40: * @return {Array<interfaces.BluetoothDevice.DeviceInfo>} On ...
4 years, 1 month ago (2016-11-10 01:02:14 UTC) #55
Dan Beam
4 years, 1 month ago (2016-11-10 03:22:54 UTC) #56
Message was sent while issue was closed.
https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resourc...
File chrome/browser/resources/bluetooth_internals/adapter_broker.js (right):

https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resourc...
chrome/browser/resources/bluetooth_internals/adapter_broker.js:135: }
On 2016/11/10 01:02:13, mbrunson wrote:
> On 2016/11/09 18:00:32, Dan Beam wrote:
> > no curlies
> 
> This doesn't fit on one line.
> 
>
https://engdoc.corp.google.com/eng/doc/devguide/js/styleguide.shtml?cl=head#f...
> 
> Unless we're using a different style guide?

yeah, that doc deals with ES6 (we're using ES5 in chrome still, generally) and
is internal and google-specific (we have some chrome-specific changes).

there are also notes on the bottom of pretty much every style guide (C++, JS,
etc.) that says "be consistent".  trust me when i say that most webui code (in
general) omits curlies even if each separate line fits in 80 cols

https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resourc...
File chrome/browser/resources/bluetooth_internals/device_table.js (right):

https://codereview.chromium.org/2446823002/diff/340001/chrome/browser/resourc...
chrome/browser/resources/bluetooth_internals/device_table.js:135: obj =
obj[part];
On 2016/11/10 01:02:13, mbrunson wrote:
> On 2016/11/09 18:00:32, Dan Beam wrote:
> > can you use cr.exportPath() here?
> 
> cr.exportPath doesn't quite do what I want. I don't want to change the object,
I
> just want the value at the end of the path or null if it's not there. I'd
still
> have to traverse the path if I use cr.exportPath to get the value I want.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698