• Giovanni Ortuño Urquidi's avatar
    bluetooth: Move controller logic out of BluetoothDetailedView · 9d948785
    Giovanni Ortuño Urquidi authored
    For the most part, this CL just moves the controller logic out of
    BluetoothDetailedView and into UnifiedBluetoothDetailedViewController.
    
    But there are three exceptions:
    
    1. Before, Layout() was called at the end of
       BluetoothDetailedView::DoUpdate(). Now, Layout() is called
       indirectly in UpdateDeviceScrollList() through,
       ShowBluetoothDisabledPanel, HideBluetoothDisabledPanel, and
       BluetoothDetailedView::UpdateDeviceScrollList().
    
    2. BluetoothDetailedView::UpdateDeviceScrollList() used to perform the
       following steps:
    
       1. Clear the device list
       2. If state is not "powered" show the "bluetooth disabled" panel
          and return.
       3. Otherwise hide the "bluetooth disabled" panel.
       4. Update the device list.
    
       Now UBDVC::UpdateDeviceScrollList() performs the following steps:
    
       1. If state is not "powered" then call
          BDV::ShowBluetoothDisabledPanel() and return
         1.1. Clear device list
         1.2. Show "bluetooth disabled" panel
       2. Otherwise call BDV::HideBluetoothDisabledPanel()
         2.1. Hide "bluetooth disabled" panel
       3. Call BDV::UpdateDeviceScrollList()
         3.1. Clear device list
         3.2. Populate device list with current devices.
    
       Similar set of steps but except that "clear device list" is
       performed by two separate functions.
    
    3. Discovery stops when UnifiedBluetoothDetailedViewController gets
       destroyed. Before, discovery was stopped when BluetoothDetailedView
       was destroyed.
    
    
    Change-Id: I4727bcdf35e0f84ab16ff0bace8f3d89aefc58de
    Reviewed-on: https://chromium-review.googlesource.com/c/1308241
    Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
    Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#605213}
    9d948785
unified_bluetooth_detailed_view_controller.h 1.94 KB