bluetooth_device_list_controller.cc 897 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 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. #include "ash/system/bluetooth/bluetooth_device_list_controller.h"
  5. #include "ash/system/bluetooth/bluetooth_device_list_controller_impl.h"
  6. namespace ash {
  7. namespace {
  8. BluetoothDeviceListController::Factory* g_test_factory = nullptr;
  9. } // namespace
  10. std::unique_ptr<BluetoothDeviceListController>
  11. BluetoothDeviceListController::Factory::Create(
  12. BluetoothDetailedView* bluetooth_detailed_view) {
  13. if (g_test_factory)
  14. return g_test_factory->CreateForTesting(); // IN-TEST
  15. return std::make_unique<BluetoothDeviceListControllerImpl>(
  16. bluetooth_detailed_view);
  17. }
  18. void BluetoothDeviceListController::Factory::SetFactoryForTesting(
  19. Factory* test_factory) {
  20. g_test_factory = test_factory;
  21. }
  22. } // namespace ash