OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bluetooth_node_client.h" | 5 #include "chromeos/dbus/bluetooth_node_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 | 36 |
37 // The BluetoothNodeClient implementation used in production. | 37 // The BluetoothNodeClient implementation used in production. |
38 class BluetoothNodeClientImpl: public BluetoothNodeClient, | 38 class BluetoothNodeClientImpl: public BluetoothNodeClient, |
39 private BluetoothDeviceClient::Observer { | 39 private BluetoothDeviceClient::Observer { |
40 public: | 40 public: |
41 BluetoothNodeClientImpl(dbus::Bus* bus, | 41 BluetoothNodeClientImpl(dbus::Bus* bus, |
42 BluetoothDeviceClient* device_client) | 42 BluetoothDeviceClient* device_client) |
43 : bus_(bus), | 43 : bus_(bus), |
44 weak_ptr_factory_(this) { | 44 weak_ptr_factory_(this) { |
45 DVLOG(1) << "Creating BluetoothNodeClientImpl"; | |
46 | |
47 DCHECK(device_client); | 45 DCHECK(device_client); |
48 device_client->AddObserver(this); | 46 device_client->AddObserver(this); |
49 } | 47 } |
50 | 48 |
51 virtual ~BluetoothNodeClientImpl() { | 49 virtual ~BluetoothNodeClientImpl() { |
52 // Clean up Properties structures | 50 // Clean up Properties structures |
53 for (ObjectMap::iterator iter = object_map_.begin(); | 51 for (ObjectMap::iterator iter = object_map_.begin(); |
54 iter != object_map_.end(); ++iter) { | 52 iter != object_map_.end(); ++iter) { |
55 Object object = iter->second; | 53 Object object = iter->second; |
56 Properties* properties = object.second; | 54 Properties* properties = object.second; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DBusClientImplementationType type, | 194 DBusClientImplementationType type, |
197 dbus::Bus* bus, | 195 dbus::Bus* bus, |
198 BluetoothDeviceClient* adapter_client) { | 196 BluetoothDeviceClient* adapter_client) { |
199 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 197 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
200 return new BluetoothNodeClientImpl(bus, adapter_client); | 198 return new BluetoothNodeClientImpl(bus, adapter_client); |
201 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 199 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
202 return new BluetoothNodeClientStubImpl(); | 200 return new BluetoothNodeClientStubImpl(); |
203 } | 201 } |
204 | 202 |
205 } // namespace chromeos | 203 } // namespace chromeos |
OLD | NEW |