Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / chromeos / dbus / fake_bluetooth_le_advertisement_service_provider.cc
blob24bfb4f3a3ae0208a1ad51f5ae119842010ba936
1 // Copyright 2015 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.
5 #include "chromeos/dbus/dbus_thread_manager.h"
6 #include "fake_bluetooth_le_advertisement_service_provider.h"
7 #include "fake_bluetooth_le_advertising_manager_client.h"
9 namespace chromeos {
11 FakeBluetoothLEAdvertisementServiceProvider::
12 FakeBluetoothLEAdvertisementServiceProvider(
13 const dbus::ObjectPath& object_path,
14 Delegate* delegate)
15 : object_path_(object_path), delegate_(delegate) {
16 VLOG(1) << "Creating Bluetooth Advertisement: " << object_path_.value();
18 FakeBluetoothLEAdvertisingManagerClient*
19 fake_bluetooth_profile_manager_client =
20 static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
21 DBusThreadManager::Get()
22 ->GetBluetoothLEAdvertisingManagerClient());
23 fake_bluetooth_profile_manager_client->RegisterAdvertisementServiceProvider(
24 this);
27 FakeBluetoothLEAdvertisementServiceProvider::
28 ~FakeBluetoothLEAdvertisementServiceProvider() {
29 VLOG(1) << "Cleaning up Bluetooth Advertisement: " << object_path_.value();
31 FakeBluetoothLEAdvertisingManagerClient*
32 fake_bluetooth_profile_manager_client =
33 static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
34 DBusThreadManager::Get()
35 ->GetBluetoothLEAdvertisingManagerClient());
36 fake_bluetooth_profile_manager_client->UnregisterAdvertisementServiceProvider(
37 this);
40 void FakeBluetoothLEAdvertisementServiceProvider::Release() {
41 VLOG(1) << object_path_.value() << ": Release";
42 delegate_->Released();
45 } // namespace chromeos