diff options
author | slan <slan@chromium.org> | 2015-11-10 19:04:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-11 03:05:18 +0000 |
commit | 93fff562c04d7701145b06eba036852199b02707 (patch) | |
tree | 189e509e04011ccd974c255ca294c298f099b473 /device | |
parent | 5a2ae99953738eaefe9ddb813289e0eafc598200 (diff) | |
download | chromium_src-93fff562c04d7701145b06eba036852199b02707.zip chromium_src-93fff562c04d7701145b06eba036852199b02707.tar.gz chromium_src-93fff562c04d7701145b06eba036852199b02707.tar.bz2 |
Add a stub BluetoothAdapter for Linux builds without dbus.
Linux builds which don't use dbus should not use the bluez
BluetoothAdapter implementation. Provide a factory method which returns
a null pointer for this type of build.
Verified with an internal Chromecast build (dbus = false).
BUG=
Review URL: https://codereview.chromium.org/1431393002
Cr-Commit-Position: refs/heads/master@{#359028}
Diffstat (limited to 'device')
-rw-r--r-- | device/bluetooth/BUILD.gn | 229 | ||||
-rw-r--r-- | device/bluetooth/bluetooth.gyp | 244 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_adapter_factory.cc | 4 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_adapter_stub.cc | 18 |
4 files changed, 258 insertions, 237 deletions
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn index 06a657a..82c266f 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -1,6 +1,7 @@ # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/features.gni") if (is_android) { import("//build/config/android/rules.gni") # For generate_jni(). @@ -129,10 +130,6 @@ component("bluetooth") { deps += [ "//chromeos" ] } - if (is_chromeos || is_linux) { - deps += [ "//dbus" ] - } - if (is_mac) { libs = [ "IOBluetooth.framework" ] } @@ -142,115 +139,121 @@ component("bluetooth") { } if (is_chromeos || is_linux) { - sources += [ - "bluetooth_adapter_bluez.cc", - "bluetooth_adapter_bluez.h", - "bluetooth_adapter_profile_bluez.cc", - "bluetooth_adapter_profile_bluez.h", - "bluetooth_advertisement_bluez.cc", - "bluetooth_advertisement_bluez.h", - "bluetooth_audio_sink_bluez.cc", - "bluetooth_audio_sink_bluez.h", - "bluetooth_device_bluez.cc", - "bluetooth_device_bluez.h", - "bluetooth_gatt_connection_bluez.cc", - "bluetooth_gatt_connection_bluez.h", - "bluetooth_gatt_notify_session_bluez.cc", - "bluetooth_gatt_notify_session_bluez.h", - "bluetooth_pairing_bluez.cc", - "bluetooth_pairing_bluez.h", - "bluetooth_remote_gatt_characteristic_bluez.cc", - "bluetooth_remote_gatt_characteristic_bluez.h", - "bluetooth_remote_gatt_descriptor_bluez.cc", - "bluetooth_remote_gatt_descriptor_bluez.h", - "bluetooth_remote_gatt_service_bluez.cc", - "bluetooth_remote_gatt_service_bluez.h", - "bluetooth_socket_bluez.cc", - "bluetooth_socket_bluez.h", - "dbus/bluetooth_adapter_client.cc", - "dbus/bluetooth_adapter_client.h", - "dbus/bluetooth_agent_manager_client.cc", - "dbus/bluetooth_agent_manager_client.h", - "dbus/bluetooth_agent_service_provider.cc", - "dbus/bluetooth_agent_service_provider.h", - "dbus/bluetooth_dbus_client_bundle.cc", - "dbus/bluetooth_dbus_client_bundle.h", - "dbus/bluetooth_device_client.cc", - "dbus/bluetooth_device_client.h", - "dbus/bluetooth_gatt_characteristic_client.cc", - "dbus/bluetooth_gatt_characteristic_client.h", - "dbus/bluetooth_gatt_characteristic_service_provider.cc", - "dbus/bluetooth_gatt_characteristic_service_provider.h", - "dbus/bluetooth_gatt_descriptor_client.cc", - "dbus/bluetooth_gatt_descriptor_client.h", - "dbus/bluetooth_gatt_descriptor_service_provider.cc", - "dbus/bluetooth_gatt_descriptor_service_provider.h", - "dbus/bluetooth_gatt_manager_client.cc", - "dbus/bluetooth_gatt_manager_client.h", - "dbus/bluetooth_gatt_service_client.cc", - "dbus/bluetooth_gatt_service_client.h", - "dbus/bluetooth_gatt_service_service_provider.cc", - "dbus/bluetooth_gatt_service_service_provider.h", - "dbus/bluetooth_input_client.cc", - "dbus/bluetooth_input_client.h", - "dbus/bluetooth_le_advertisement_service_provider.cc", - "dbus/bluetooth_le_advertisement_service_provider.h", - "dbus/bluetooth_le_advertising_manager_client.cc", - "dbus/bluetooth_le_advertising_manager_client.h", - "dbus/bluetooth_media_client.cc", - "dbus/bluetooth_media_client.h", - "dbus/bluetooth_media_endpoint_service_provider.cc", - "dbus/bluetooth_media_endpoint_service_provider.h", - "dbus/bluetooth_media_transport_client.cc", - "dbus/bluetooth_media_transport_client.h", - "dbus/bluetooth_profile_manager_client.cc", - "dbus/bluetooth_profile_manager_client.h", - "dbus/bluetooth_profile_service_provider.cc", - "dbus/bluetooth_profile_service_provider.h", - "dbus/bluez_dbus_client.h", - "dbus/bluez_dbus_manager.cc", - "dbus/bluez_dbus_manager.h", - "dbus/dbus_thread_manager_linux.cc", - "dbus/dbus_thread_manager_linux.h", - "dbus/fake_bluetooth_adapter_client.cc", - "dbus/fake_bluetooth_adapter_client.h", - "dbus/fake_bluetooth_agent_manager_client.cc", - "dbus/fake_bluetooth_agent_manager_client.h", - "dbus/fake_bluetooth_agent_service_provider.cc", - "dbus/fake_bluetooth_agent_service_provider.h", - "dbus/fake_bluetooth_device_client.cc", - "dbus/fake_bluetooth_device_client.h", - "dbus/fake_bluetooth_gatt_characteristic_client.cc", - "dbus/fake_bluetooth_gatt_characteristic_client.h", - "dbus/fake_bluetooth_gatt_characteristic_service_provider.cc", - "dbus/fake_bluetooth_gatt_characteristic_service_provider.h", - "dbus/fake_bluetooth_gatt_descriptor_client.cc", - "dbus/fake_bluetooth_gatt_descriptor_client.h", - "dbus/fake_bluetooth_gatt_descriptor_service_provider.cc", - "dbus/fake_bluetooth_gatt_descriptor_service_provider.h", - "dbus/fake_bluetooth_gatt_manager_client.cc", - "dbus/fake_bluetooth_gatt_manager_client.h", - "dbus/fake_bluetooth_gatt_service_client.cc", - "dbus/fake_bluetooth_gatt_service_client.h", - "dbus/fake_bluetooth_gatt_service_service_provider.cc", - "dbus/fake_bluetooth_gatt_service_service_provider.h", - "dbus/fake_bluetooth_input_client.cc", - "dbus/fake_bluetooth_input_client.h", - "dbus/fake_bluetooth_le_advertisement_service_provider.cc", - "dbus/fake_bluetooth_le_advertisement_service_provider.h", - "dbus/fake_bluetooth_le_advertising_manager_client.cc", - "dbus/fake_bluetooth_le_advertising_manager_client.h", - "dbus/fake_bluetooth_media_client.cc", - "dbus/fake_bluetooth_media_client.h", - "dbus/fake_bluetooth_media_endpoint_service_provider.cc", - "dbus/fake_bluetooth_media_endpoint_service_provider.h", - "dbus/fake_bluetooth_media_transport_client.cc", - "dbus/fake_bluetooth_media_transport_client.h", - "dbus/fake_bluetooth_profile_manager_client.cc", - "dbus/fake_bluetooth_profile_manager_client.h", - "dbus/fake_bluetooth_profile_service_provider.cc", - "dbus/fake_bluetooth_profile_service_provider.h", - ] + if (use_dbus) { + sources += [ + "bluetooth_adapter_bluez.cc", + "bluetooth_adapter_bluez.h", + "bluetooth_adapter_profile_bluez.cc", + "bluetooth_adapter_profile_bluez.h", + "bluetooth_advertisement_bluez.cc", + "bluetooth_advertisement_bluez.h", + "bluetooth_audio_sink_bluez.cc", + "bluetooth_audio_sink_bluez.h", + "bluetooth_device_bluez.cc", + "bluetooth_device_bluez.h", + "bluetooth_gatt_connection_bluez.cc", + "bluetooth_gatt_connection_bluez.h", + "bluetooth_gatt_notify_session_bluez.cc", + "bluetooth_gatt_notify_session_bluez.h", + "bluetooth_pairing_bluez.cc", + "bluetooth_pairing_bluez.h", + "bluetooth_remote_gatt_characteristic_bluez.cc", + "bluetooth_remote_gatt_characteristic_bluez.h", + "bluetooth_remote_gatt_descriptor_bluez.cc", + "bluetooth_remote_gatt_descriptor_bluez.h", + "bluetooth_remote_gatt_service_bluez.cc", + "bluetooth_remote_gatt_service_bluez.h", + "bluetooth_socket_bluez.cc", + "bluetooth_socket_bluez.h", + "dbus/bluetooth_adapter_client.cc", + "dbus/bluetooth_adapter_client.h", + "dbus/bluetooth_agent_manager_client.cc", + "dbus/bluetooth_agent_manager_client.h", + "dbus/bluetooth_agent_service_provider.cc", + "dbus/bluetooth_agent_service_provider.h", + "dbus/bluetooth_dbus_client_bundle.cc", + "dbus/bluetooth_dbus_client_bundle.h", + "dbus/bluetooth_device_client.cc", + "dbus/bluetooth_device_client.h", + "dbus/bluetooth_gatt_characteristic_client.cc", + "dbus/bluetooth_gatt_characteristic_client.h", + "dbus/bluetooth_gatt_characteristic_service_provider.cc", + "dbus/bluetooth_gatt_characteristic_service_provider.h", + "dbus/bluetooth_gatt_descriptor_client.cc", + "dbus/bluetooth_gatt_descriptor_client.h", + "dbus/bluetooth_gatt_descriptor_service_provider.cc", + "dbus/bluetooth_gatt_descriptor_service_provider.h", + "dbus/bluetooth_gatt_manager_client.cc", + "dbus/bluetooth_gatt_manager_client.h", + "dbus/bluetooth_gatt_service_client.cc", + "dbus/bluetooth_gatt_service_client.h", + "dbus/bluetooth_gatt_service_service_provider.cc", + "dbus/bluetooth_gatt_service_service_provider.h", + "dbus/bluetooth_input_client.cc", + "dbus/bluetooth_input_client.h", + "dbus/bluetooth_le_advertisement_service_provider.cc", + "dbus/bluetooth_le_advertisement_service_provider.h", + "dbus/bluetooth_le_advertising_manager_client.cc", + "dbus/bluetooth_le_advertising_manager_client.h", + "dbus/bluetooth_media_client.cc", + "dbus/bluetooth_media_client.h", + "dbus/bluetooth_media_endpoint_service_provider.cc", + "dbus/bluetooth_media_endpoint_service_provider.h", + "dbus/bluetooth_media_transport_client.cc", + "dbus/bluetooth_media_transport_client.h", + "dbus/bluetooth_profile_manager_client.cc", + "dbus/bluetooth_profile_manager_client.h", + "dbus/bluetooth_profile_service_provider.cc", + "dbus/bluetooth_profile_service_provider.h", + "dbus/bluez_dbus_client.h", + "dbus/bluez_dbus_manager.cc", + "dbus/bluez_dbus_manager.h", + "dbus/dbus_thread_manager_linux.cc", + "dbus/dbus_thread_manager_linux.h", + "dbus/fake_bluetooth_adapter_client.cc", + "dbus/fake_bluetooth_adapter_client.h", + "dbus/fake_bluetooth_agent_manager_client.cc", + "dbus/fake_bluetooth_agent_manager_client.h", + "dbus/fake_bluetooth_agent_service_provider.cc", + "dbus/fake_bluetooth_agent_service_provider.h", + "dbus/fake_bluetooth_device_client.cc", + "dbus/fake_bluetooth_device_client.h", + "dbus/fake_bluetooth_gatt_characteristic_client.cc", + "dbus/fake_bluetooth_gatt_characteristic_client.h", + "dbus/fake_bluetooth_gatt_characteristic_service_provider.cc", + "dbus/fake_bluetooth_gatt_characteristic_service_provider.h", + "dbus/fake_bluetooth_gatt_descriptor_client.cc", + "dbus/fake_bluetooth_gatt_descriptor_client.h", + "dbus/fake_bluetooth_gatt_descriptor_service_provider.cc", + "dbus/fake_bluetooth_gatt_descriptor_service_provider.h", + "dbus/fake_bluetooth_gatt_manager_client.cc", + "dbus/fake_bluetooth_gatt_manager_client.h", + "dbus/fake_bluetooth_gatt_service_client.cc", + "dbus/fake_bluetooth_gatt_service_client.h", + "dbus/fake_bluetooth_gatt_service_service_provider.cc", + "dbus/fake_bluetooth_gatt_service_service_provider.h", + "dbus/fake_bluetooth_input_client.cc", + "dbus/fake_bluetooth_input_client.h", + "dbus/fake_bluetooth_le_advertisement_service_provider.cc", + "dbus/fake_bluetooth_le_advertisement_service_provider.h", + "dbus/fake_bluetooth_le_advertising_manager_client.cc", + "dbus/fake_bluetooth_le_advertising_manager_client.h", + "dbus/fake_bluetooth_media_client.cc", + "dbus/fake_bluetooth_media_client.h", + "dbus/fake_bluetooth_media_endpoint_service_provider.cc", + "dbus/fake_bluetooth_media_endpoint_service_provider.h", + "dbus/fake_bluetooth_media_transport_client.cc", + "dbus/fake_bluetooth_media_transport_client.h", + "dbus/fake_bluetooth_profile_manager_client.cc", + "dbus/fake_bluetooth_profile_manager_client.h", + "dbus/fake_bluetooth_profile_service_provider.cc", + "dbus/fake_bluetooth_profile_service_provider.h", + ] + + deps += [ "//dbus" ] + } else { # !use_dbus + sources += [ "bluetooth_adapter_stub.cc" ] + } } } diff --git a/device/bluetooth/bluetooth.gyp b/device/bluetooth/bluetooth.gyp index b4f90f2..a064db4 100644 --- a/device/bluetooth/bluetooth.gyp +++ b/device/bluetooth/bluetooth.gyp @@ -111,128 +111,132 @@ 'bluetooth_uuid.h', ], 'conditions': [ - # This block will also build for Linux once we write the linux - # implementation of BluezDbusManager. ['chromeos==1 or OS=="linux"', { - 'defines': [ - 'DEVICE_BLUETOOTH_IMPLEMENTATION', - ], - 'sources': [ - 'bluetooth_adapter_bluez.cc', - 'bluetooth_adapter_bluez.h', - 'bluetooth_adapter_profile_bluez.cc', - 'bluetooth_adapter_profile_bluez.h', - 'bluetooth_advertisement_bluez.cc', - 'bluetooth_advertisement_bluez.h', - 'bluetooth_audio_sink_bluez.cc', - 'bluetooth_audio_sink_bluez.h', - 'bluetooth_device_bluez.cc', - 'bluetooth_device_bluez.h', - 'bluetooth_gatt_connection_bluez.cc', - 'bluetooth_gatt_connection_bluez.h', - 'bluetooth_gatt_notify_session_bluez.cc', - 'bluetooth_gatt_notify_session_bluez.h', - 'bluetooth_pairing_bluez.cc', - 'bluetooth_pairing_bluez.h', - 'bluetooth_remote_gatt_characteristic_bluez.cc', - 'bluetooth_remote_gatt_characteristic_bluez.h', - 'bluetooth_remote_gatt_descriptor_bluez.cc', - 'bluetooth_remote_gatt_descriptor_bluez.h', - 'bluetooth_remote_gatt_service_bluez.cc', - 'bluetooth_remote_gatt_service_bluez.h', - 'bluetooth_socket_bluez.cc', - 'bluetooth_socket_bluez.h', - 'dbus/bluetooth_adapter_client.cc', - 'dbus/bluetooth_adapter_client.h', - 'dbus/bluetooth_le_advertising_manager_client.cc', - 'dbus/bluetooth_le_advertising_manager_client.h', - 'dbus/bluetooth_le_advertisement_service_provider.cc', - 'dbus/bluetooth_le_advertisement_service_provider.h', - 'dbus/bluetooth_agent_manager_client.cc', - 'dbus/bluetooth_agent_manager_client.h', - 'dbus/bluetooth_agent_service_provider.cc', - 'dbus/bluetooth_agent_service_provider.h', - 'dbus/bluetooth_dbus_client_bundle.cc', - 'dbus/bluetooth_dbus_client_bundle.h', - 'dbus/bluetooth_device_client.cc', - 'dbus/bluetooth_device_client.h', - 'dbus/bluetooth_gatt_characteristic_client.cc', - 'dbus/bluetooth_gatt_characteristic_client.h', - 'dbus/bluetooth_gatt_characteristic_service_provider.cc', - 'dbus/bluetooth_gatt_characteristic_service_provider.h', - 'dbus/bluetooth_gatt_descriptor_client.cc', - 'dbus/bluetooth_gatt_descriptor_client.h', - 'dbus/bluetooth_gatt_descriptor_service_provider.cc', - 'dbus/bluetooth_gatt_descriptor_service_provider.h', - 'dbus/bluetooth_gatt_manager_client.cc', - 'dbus/bluetooth_gatt_manager_client.h', - 'dbus/bluetooth_gatt_service_client.cc', - 'dbus/bluetooth_gatt_service_client.h', - 'dbus/bluetooth_gatt_service_service_provider.cc', - 'dbus/bluetooth_gatt_service_service_provider.h', - 'dbus/bluetooth_input_client.cc', - 'dbus/bluetooth_input_client.h', - 'dbus/bluetooth_media_client.cc', - 'dbus/bluetooth_media_client.h', - 'dbus/bluetooth_media_endpoint_service_provider.cc', - 'dbus/bluetooth_media_endpoint_service_provider.h', - 'dbus/bluetooth_media_transport_client.cc', - 'dbus/bluetooth_media_transport_client.h', - 'dbus/bluetooth_profile_manager_client.cc', - 'dbus/bluetooth_profile_manager_client.h', - 'dbus/bluetooth_profile_service_provider.cc', - 'dbus/bluetooth_profile_service_provider.h', - 'dbus/bluez_dbus_client.h', - 'dbus/bluez_dbus_manager.cc', - 'dbus/bluez_dbus_manager.h', - 'dbus/dbus_thread_manager_linux.cc', - 'dbus/dbus_thread_manager_linux.h', - 'dbus/fake_bluetooth_adapter_client.cc', - 'dbus/fake_bluetooth_adapter_client.h', - 'dbus/fake_bluetooth_le_advertising_manager_client.cc', - 'dbus/fake_bluetooth_le_advertising_manager_client.h', - 'dbus/fake_bluetooth_le_advertisement_service_provider.cc', - 'dbus/fake_bluetooth_le_advertisement_service_provider.h', - 'dbus/fake_bluetooth_agent_manager_client.cc', - 'dbus/fake_bluetooth_agent_manager_client.h', - 'dbus/fake_bluetooth_agent_service_provider.cc', - 'dbus/fake_bluetooth_agent_service_provider.h', - 'dbus/fake_bluetooth_device_client.cc', - 'dbus/fake_bluetooth_device_client.h', - 'dbus/fake_bluetooth_gatt_characteristic_client.cc', - 'dbus/fake_bluetooth_gatt_characteristic_client.h', - 'dbus/fake_bluetooth_gatt_characteristic_service_provider.cc', - 'dbus/fake_bluetooth_gatt_characteristic_service_provider.h', - 'dbus/fake_bluetooth_gatt_descriptor_client.cc', - 'dbus/fake_bluetooth_gatt_descriptor_client.h', - 'dbus/fake_bluetooth_gatt_descriptor_service_provider.cc', - 'dbus/fake_bluetooth_gatt_descriptor_service_provider.h', - 'dbus/fake_bluetooth_gatt_manager_client.cc', - 'dbus/fake_bluetooth_gatt_manager_client.h', - 'dbus/fake_bluetooth_gatt_service_client.cc', - 'dbus/fake_bluetooth_gatt_service_client.h', - 'dbus/fake_bluetooth_gatt_service_service_provider.cc', - 'dbus/fake_bluetooth_gatt_service_service_provider.h', - 'dbus/fake_bluetooth_input_client.cc', - 'dbus/fake_bluetooth_input_client.h', - 'dbus/fake_bluetooth_media_client.cc', - 'dbus/fake_bluetooth_media_client.h', - 'dbus/fake_bluetooth_media_endpoint_service_provider.cc', - 'dbus/fake_bluetooth_media_endpoint_service_provider.h', - 'dbus/fake_bluetooth_media_transport_client.cc', - 'dbus/fake_bluetooth_media_transport_client.h', - 'dbus/fake_bluetooth_profile_manager_client.cc', - 'dbus/fake_bluetooth_profile_manager_client.h', - 'dbus/fake_bluetooth_profile_service_provider.cc', - 'dbus/fake_bluetooth_profile_service_provider.h', - ], - 'dependencies': [ - '../../build/linux/system.gyp:dbus', - '../../dbus/dbus.gyp:dbus', + 'conditions': [ + ['use_dbus==1', { + 'defines': [ + 'DEVICE_BLUETOOTH_IMPLEMENTATION', + ], + 'sources': [ + 'bluetooth_adapter_bluez.cc', + 'bluetooth_adapter_bluez.h', + 'bluetooth_adapter_profile_bluez.cc', + 'bluetooth_adapter_profile_bluez.h', + 'bluetooth_advertisement_bluez.cc', + 'bluetooth_advertisement_bluez.h', + 'bluetooth_audio_sink_bluez.cc', + 'bluetooth_audio_sink_bluez.h', + 'bluetooth_device_bluez.cc', + 'bluetooth_device_bluez.h', + 'bluetooth_gatt_connection_bluez.cc', + 'bluetooth_gatt_connection_bluez.h', + 'bluetooth_gatt_notify_session_bluez.cc', + 'bluetooth_gatt_notify_session_bluez.h', + 'bluetooth_pairing_bluez.cc', + 'bluetooth_pairing_bluez.h', + 'bluetooth_remote_gatt_characteristic_bluez.cc', + 'bluetooth_remote_gatt_characteristic_bluez.h', + 'bluetooth_remote_gatt_descriptor_bluez.cc', + 'bluetooth_remote_gatt_descriptor_bluez.h', + 'bluetooth_remote_gatt_service_bluez.cc', + 'bluetooth_remote_gatt_service_bluez.h', + 'bluetooth_socket_bluez.cc', + 'bluetooth_socket_bluez.h', + 'dbus/bluetooth_adapter_client.cc', + 'dbus/bluetooth_adapter_client.h', + 'dbus/bluetooth_le_advertising_manager_client.cc', + 'dbus/bluetooth_le_advertising_manager_client.h', + 'dbus/bluetooth_le_advertisement_service_provider.cc', + 'dbus/bluetooth_le_advertisement_service_provider.h', + 'dbus/bluetooth_agent_manager_client.cc', + 'dbus/bluetooth_agent_manager_client.h', + 'dbus/bluetooth_agent_service_provider.cc', + 'dbus/bluetooth_agent_service_provider.h', + 'dbus/bluetooth_dbus_client_bundle.cc', + 'dbus/bluetooth_dbus_client_bundle.h', + 'dbus/bluetooth_device_client.cc', + 'dbus/bluetooth_device_client.h', + 'dbus/bluetooth_gatt_characteristic_client.cc', + 'dbus/bluetooth_gatt_characteristic_client.h', + 'dbus/bluetooth_gatt_characteristic_service_provider.cc', + 'dbus/bluetooth_gatt_characteristic_service_provider.h', + 'dbus/bluetooth_gatt_descriptor_client.cc', + 'dbus/bluetooth_gatt_descriptor_client.h', + 'dbus/bluetooth_gatt_descriptor_service_provider.cc', + 'dbus/bluetooth_gatt_descriptor_service_provider.h', + 'dbus/bluetooth_gatt_manager_client.cc', + 'dbus/bluetooth_gatt_manager_client.h', + 'dbus/bluetooth_gatt_service_client.cc', + 'dbus/bluetooth_gatt_service_client.h', + 'dbus/bluetooth_gatt_service_service_provider.cc', + 'dbus/bluetooth_gatt_service_service_provider.h', + 'dbus/bluetooth_input_client.cc', + 'dbus/bluetooth_input_client.h', + 'dbus/bluetooth_media_client.cc', + 'dbus/bluetooth_media_client.h', + 'dbus/bluetooth_media_endpoint_service_provider.cc', + 'dbus/bluetooth_media_endpoint_service_provider.h', + 'dbus/bluetooth_media_transport_client.cc', + 'dbus/bluetooth_media_transport_client.h', + 'dbus/bluetooth_profile_manager_client.cc', + 'dbus/bluetooth_profile_manager_client.h', + 'dbus/bluetooth_profile_service_provider.cc', + 'dbus/bluetooth_profile_service_provider.h', + 'dbus/bluez_dbus_client.h', + 'dbus/bluez_dbus_manager.cc', + 'dbus/bluez_dbus_manager.h', + 'dbus/dbus_thread_manager_linux.cc', + 'dbus/dbus_thread_manager_linux.h', + 'dbus/fake_bluetooth_adapter_client.cc', + 'dbus/fake_bluetooth_adapter_client.h', + 'dbus/fake_bluetooth_le_advertising_manager_client.cc', + 'dbus/fake_bluetooth_le_advertising_manager_client.h', + 'dbus/fake_bluetooth_le_advertisement_service_provider.cc', + 'dbus/fake_bluetooth_le_advertisement_service_provider.h', + 'dbus/fake_bluetooth_agent_manager_client.cc', + 'dbus/fake_bluetooth_agent_manager_client.h', + 'dbus/fake_bluetooth_agent_service_provider.cc', + 'dbus/fake_bluetooth_agent_service_provider.h', + 'dbus/fake_bluetooth_device_client.cc', + 'dbus/fake_bluetooth_device_client.h', + 'dbus/fake_bluetooth_gatt_characteristic_client.cc', + 'dbus/fake_bluetooth_gatt_characteristic_client.h', + 'dbus/fake_bluetooth_gatt_characteristic_service_provider.cc', + 'dbus/fake_bluetooth_gatt_characteristic_service_provider.h', + 'dbus/fake_bluetooth_gatt_descriptor_client.cc', + 'dbus/fake_bluetooth_gatt_descriptor_client.h', + 'dbus/fake_bluetooth_gatt_descriptor_service_provider.cc', + 'dbus/fake_bluetooth_gatt_descriptor_service_provider.h', + 'dbus/fake_bluetooth_gatt_manager_client.cc', + 'dbus/fake_bluetooth_gatt_manager_client.h', + 'dbus/fake_bluetooth_gatt_service_client.cc', + 'dbus/fake_bluetooth_gatt_service_client.h', + 'dbus/fake_bluetooth_gatt_service_service_provider.cc', + 'dbus/fake_bluetooth_gatt_service_service_provider.h', + 'dbus/fake_bluetooth_input_client.cc', + 'dbus/fake_bluetooth_input_client.h', + 'dbus/fake_bluetooth_media_client.cc', + 'dbus/fake_bluetooth_media_client.h', + 'dbus/fake_bluetooth_media_endpoint_service_provider.cc', + 'dbus/fake_bluetooth_media_endpoint_service_provider.h', + 'dbus/fake_bluetooth_media_transport_client.cc', + 'dbus/fake_bluetooth_media_transport_client.h', + 'dbus/fake_bluetooth_profile_manager_client.cc', + 'dbus/fake_bluetooth_profile_manager_client.h', + 'dbus/fake_bluetooth_profile_service_provider.cc', + 'dbus/fake_bluetooth_profile_service_provider.h', + ], + 'dependencies': [ + '../../build/linux/system.gyp:dbus', + '../../dbus/dbus.gyp:dbus', + ], + 'export_dependent_settings': [ + '../../build/linux/system.gyp:dbus' + ] + }, { # !use_dbus + 'sources': [ 'bluetooth_adapter_stub.cc' ] + }], ], - 'export_dependent_settings': [ - '../../build/linux/system.gyp:dbus' - ] }], ['chromeos==1', { 'dependencies': [ diff --git a/device/bluetooth/bluetooth_adapter_factory.cc b/device/bluetooth/bluetooth_adapter_factory.cc index 9771439..2162034 100644 --- a/device/bluetooth/bluetooth_adapter_factory.cc +++ b/device/bluetooth/bluetooth_adapter_factory.cc @@ -12,10 +12,6 @@ #include "base/memory/weak_ptr.h" #include "device/bluetooth/bluetooth_adapter.h" -#if defined(OS_CHROMEOS) || defined(OS_LINUX) -#include "device/bluetooth/bluetooth_adapter_bluez.h" -#endif - #if defined(OS_MACOSX) #include "base/mac/mac_util.h" #endif diff --git a/device/bluetooth/bluetooth_adapter_stub.cc b/device/bluetooth/bluetooth_adapter_stub.cc new file mode 100644 index 0000000..fc62f95 --- /dev/null +++ b/device/bluetooth/bluetooth_adapter_stub.cc @@ -0,0 +1,18 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/memory/weak_ptr.h" +#include "device/bluetooth/bluetooth_adapter.h" + +namespace device { + +// Return a null ptr. Link this when there is no suitable BluetoothAdapter for +// a particular platform. +// static +base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( + const InitCallback& init_callback) { + return base::WeakPtr<BluetoothAdapter>(); +} + +} // namespace device |