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

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

Issue 15020009: Bluetooth: remove legacy backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chromeos/dbus/fake_old_bluetooth_manager_client.h"
6
7 namespace chromeos {
8
9 FakeOldBluetoothManagerClient::Properties::Properties(
10 const PropertyChangedCallback& callback) :
11 BluetoothManagerClient::Properties(NULL, callback) {
12 }
13
14 FakeOldBluetoothManagerClient::Properties::~Properties() {
15 }
16
17 void FakeOldBluetoothManagerClient::Properties::Get(
18 dbus::PropertyBase* property,
19 dbus::PropertySet::GetCallback callback) {
20 VLOG(1)<< "Get " << property->name();
21 callback.Run(false);
22 }
23
24 void FakeOldBluetoothManagerClient::Properties::GetAll() {
25 VLOG(1) << "GetAll";
26 }
27
28 void FakeOldBluetoothManagerClient::Properties::Set(
29 dbus::PropertyBase*property,
30 dbus::PropertySet::SetCallback callback) {
31 VLOG(1) << "Set " << property->name();
32 callback.Run(false);
33 }
34
35 FakeOldBluetoothManagerClient::FakeOldBluetoothManagerClient() {
36 properties_.reset(new Properties(base::Bind(
37 &FakeOldBluetoothManagerClient::OnPropertyChanged,
38 base::Unretained(this))));
39
40 std::vector<dbus::ObjectPath> adapters;
41 adapters.push_back(dbus::ObjectPath("/fake/hci0"));
42 properties_->adapters.ReplaceValue(adapters);
43 }
44
45 FakeOldBluetoothManagerClient::~FakeOldBluetoothManagerClient() {
46 }
47
48 void FakeOldBluetoothManagerClient::AddObserver(Observer* observer) {
49 observers_.AddObserver(observer);
50 }
51
52 void FakeOldBluetoothManagerClient::RemoveObserver(Observer* observer) {
53 observers_.RemoveObserver(observer);
54 }
55
56 FakeOldBluetoothManagerClient::Properties*
57 FakeOldBluetoothManagerClient::GetProperties() {
58 VLOG(1) << "GetProperties";
59 return properties_.get();
60 }
61
62 void FakeOldBluetoothManagerClient::DefaultAdapter(
63 const AdapterCallback& callback) {
64 VLOG(1) << "DefaultAdapter.";
65 callback.Run(dbus::ObjectPath("/fake/hci0"), true);
66 }
67
68 void FakeOldBluetoothManagerClient::FindAdapter(
69 const std::string& address,
70 const AdapterCallback& callback) {
71 VLOG(1) << "FindAdapter: " << address;
72 if (address == "hci0")
73 callback.Run(dbus::ObjectPath("/fake/hci0"), true);
74 else
75 callback.Run(dbus::ObjectPath(), false);
76 }
77
78 void FakeOldBluetoothManagerClient::OnPropertyChanged(
79 const std::string& property_name) {
80 FOR_EACH_OBSERVER(BluetoothManagerClient::Observer, observers_,
81 ManagerPropertyChanged(property_name));
82 }
83
84 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_old_bluetooth_manager_client.h ('k') | chromeos/dbus/mock_bluetooth_adapter_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698