Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: chromeos/dbus/fake_bluetooth_profile_service_provider.cc

Issue 14487002: Bluetooth: Profile support for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit tests, and class comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" 5 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h"
6 6
7 #include "chromeos/dbus/dbus_thread_manager.h"
8 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
7 #include "dbus/object_path.h" 9 #include "dbus/object_path.h"
8 10
9 namespace chromeos { 11 namespace chromeos {
10 12
11 FakeBluetoothProfileServiceProvider::FakeBluetoothProfileServiceProvider( 13 FakeBluetoothProfileServiceProvider::FakeBluetoothProfileServiceProvider(
12 const dbus::ObjectPath& object_path, 14 const dbus::ObjectPath& object_path,
13 Delegate* delegate) 15 Delegate* delegate)
14 : object_path_(object_path), 16 : object_path_(object_path),
15 delegate_(delegate) { 17 delegate_(delegate) {
16 VLOG(1) << "Creating Bluetooth Profile: " << object_path_.value(); 18 VLOG(1) << "Creating Bluetooth Profile: " << object_path_.value();
19
20 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client =
21 static_cast<FakeBluetoothProfileManagerClient*>(
22 DBusThreadManager::Get()->
23 GetExperimentalBluetoothProfileManagerClient());
24 fake_bluetooth_profile_manager_client->RegisterProfileServiceProvider(this);
17 } 25 }
18 26
19 FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() { 27 FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() {
20 VLOG(1) << "Cleaning up Bluetooth Profile: " << object_path_.value(); 28 VLOG(1) << "Cleaning up Bluetooth Profile: " << object_path_.value();
29
30 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client =
31 static_cast<FakeBluetoothProfileManagerClient*>(
32 DBusThreadManager::Get()->
33 GetExperimentalBluetoothProfileManagerClient());
34 fake_bluetooth_profile_manager_client->UnregisterProfileServiceProvider(this);
21 } 35 }
22 36
23 void FakeBluetoothProfileServiceProvider::Release() { 37 void FakeBluetoothProfileServiceProvider::Release() {
24 VLOG(1) << object_path_.value() << ": Release"; 38 VLOG(1) << object_path_.value() << ": Release";
25 delegate_->Release(); 39 delegate_->Release();
26 } 40 }
27 41
28 void FakeBluetoothProfileServiceProvider::NewConnection( 42 void FakeBluetoothProfileServiceProvider::NewConnection(
29 const dbus::ObjectPath& device_path, 43 const dbus::ObjectPath& device_path,
30 dbus::FileDescriptor* fd, 44 scoped_ptr<dbus::FileDescriptor> fd,
31 const Delegate::Options& options, 45 const Delegate::Options& options,
32 const Delegate::ConfirmationCallback& callback) { 46 const Delegate::ConfirmationCallback& callback) {
33 VLOG(1) << object_path_.value() << ": NewConnection for " 47 VLOG(1) << object_path_.value() << ": NewConnection for "
34 << device_path.value(); 48 << device_path.value();
35 delegate_->NewConnection(device_path, fd, options, callback); 49 delegate_->NewConnection(device_path, fd.Pass(), options, callback);
36 } 50 }
37 51
38 void FakeBluetoothProfileServiceProvider::RequestDisconnection( 52 void FakeBluetoothProfileServiceProvider::RequestDisconnection(
39 const dbus::ObjectPath& device_path, 53 const dbus::ObjectPath& device_path,
40 const Delegate::ConfirmationCallback& callback) { 54 const Delegate::ConfirmationCallback& callback) {
41 VLOG(1) << object_path_.value() << ": RequestDisconnection for " 55 VLOG(1) << object_path_.value() << ": RequestDisconnection for "
42 << device_path.value(); 56 << device_path.value();
43 delegate_->RequestDisconnection(device_path, callback); 57 delegate_->RequestDisconnection(device_path, callback);
44 } 58 }
45 59
46 void FakeBluetoothProfileServiceProvider::Cancel() { 60 void FakeBluetoothProfileServiceProvider::Cancel() {
47 VLOG(1) << object_path_.value() << ": Cancel"; 61 VLOG(1) << object_path_.value() << ": Cancel";
48 delegate_->Cancel(); 62 delegate_->Cancel();
49 } 63 }
50 64
51 } // namespace chromeos 65 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_bluetooth_profile_service_provider.h ('k') | device/bluetooth/bluetooth_adapter_experimental_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698