unified_bluetooth_detailed_view_controller.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_BLUETOOTH_UNIFIED_BLUETOOTH_DETAILED_VIEW_CONTROLLER_H_
  5. #define ASH_SYSTEM_BLUETOOTH_UNIFIED_BLUETOOTH_DETAILED_VIEW_CONTROLLER_H_
  6. #include <memory>
  7. #include "ash/ash_export.h"
  8. #include "ash/system/bluetooth/tray_bluetooth_helper.h"
  9. #include "ash/system/unified/detailed_view_controller.h"
  10. #include "base/timer/timer.h"
  11. namespace ash {
  12. class BluetoothDetailedViewLegacy;
  13. class DetailedViewDelegate;
  14. class UnifiedSystemTrayController;
  15. // Controller of Bluetooth detailed view in UnifiedSystemTray.
  16. class ASH_EXPORT UnifiedBluetoothDetailedViewController
  17. : public DetailedViewController,
  18. public TrayBluetoothHelper::Observer {
  19. public:
  20. explicit UnifiedBluetoothDetailedViewController(
  21. UnifiedSystemTrayController* tray_controller);
  22. UnifiedBluetoothDetailedViewController(
  23. const UnifiedBluetoothDetailedViewController&) = delete;
  24. UnifiedBluetoothDetailedViewController& operator=(
  25. const UnifiedBluetoothDetailedViewController&) = delete;
  26. ~UnifiedBluetoothDetailedViewController() override;
  27. // DetailedViewControllerBase:
  28. views::View* CreateView() override;
  29. std::u16string GetAccessibleName() const override;
  30. // BluetoothObserver:
  31. void OnBluetoothSystemStateChanged() override;
  32. void OnBluetoothScanStateChanged() override;
  33. void OnBluetoothDeviceListChanged() override;
  34. private:
  35. void UpdateDeviceListAndUI();
  36. void UpdateBluetoothDeviceList();
  37. const std::unique_ptr<DetailedViewDelegate> detailed_view_delegate_;
  38. BluetoothDetailedViewLegacy* view_ = nullptr;
  39. BluetoothDeviceList connected_devices_;
  40. BluetoothDeviceList connecting_devices_;
  41. BluetoothDeviceList paired_not_connected_devices_;
  42. BluetoothDeviceList discovered_not_paired_devices_;
  43. };
  44. } // namespace ash
  45. #endif // ASH_SYSTEM_BLUETOOTH_UNIFIED_BLUETOOTH_DETAILED_VIEW_CONTROLLER_H_