• Elly Fong-Jones's avatar
    cbui: stop using BubbleUi for bluetooth chooser · f260d671
    Elly Fong-Jones authored
    This change:
    1) Adds a new function, chrome::ShowDeviceChooserDialog, that displays a
       device chooser bypassing the BubbleUi framework
    2) Has Browser use this new function rather than BubbleUi to show the
       bluetooth device choosers
    
    Note that ShowDeviceChooserDialog returns a OnceClosure, which the client
    can call to close the dialog. It does not return a pointer to the dialog
    since the dialog is self-owning. Previously, this code dealt with that
    by passing around BubbleReferences, which have weak pointer semantics;
    returning a OnceClosure (which internally has a WeakPtr to the UI)
    allows the client code to close the bubble when it wants to without adding
    new lifetime issues.
    
    Remaining uses of ChooserBubbleDelegate directly:
    * Web USB chooser
    * HID chooser
    * Serial chooser
    
    These use similar design patterns, and will be migrated in follow-up
    changes.
    
    Bug: 496955
    Change-Id: I1b45c1cfdba6e0eaee57ef61d91da294832a0888
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2102947
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#750540}
    f260d671
bluetooth_chooser_desktop.cc 1.63 KB