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_input_client.h" | 5 #include "chromeos/dbus/bluetooth_input_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 | 47 |
48 // The BluetoothInputClient implementation used in production. | 48 // The BluetoothInputClient implementation used in production. |
49 class BluetoothInputClientImpl: public BluetoothInputClient, | 49 class BluetoothInputClientImpl: public BluetoothInputClient, |
50 private BluetoothAdapterClient::Observer { | 50 private BluetoothAdapterClient::Observer { |
51 public: | 51 public: |
52 BluetoothInputClientImpl(dbus::Bus* bus, | 52 BluetoothInputClientImpl(dbus::Bus* bus, |
53 BluetoothAdapterClient* adapter_client) | 53 BluetoothAdapterClient* adapter_client) |
54 : bus_(bus), | 54 : bus_(bus), |
55 weak_ptr_factory_(this) { | 55 weak_ptr_factory_(this) { |
56 DVLOG(1) << "Creating BluetoothInputClientImpl"; | |
57 | |
58 DCHECK(adapter_client); | 56 DCHECK(adapter_client); |
59 adapter_client->AddObserver(this); | 57 adapter_client->AddObserver(this); |
60 } | 58 } |
61 | 59 |
62 virtual ~BluetoothInputClientImpl() { | 60 virtual ~BluetoothInputClientImpl() { |
63 // Clean up Properties structures | 61 // Clean up Properties structures |
64 for (ObjectMap::iterator iter = object_map_.begin(); | 62 for (ObjectMap::iterator iter = object_map_.begin(); |
65 iter != object_map_.end(); ++iter) { | 63 iter != object_map_.end(); ++iter) { |
66 Object object = iter->second; | 64 Object object = iter->second; |
67 Properties* properties = object.second; | 65 Properties* properties = object.second; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 DBusClientImplementationType type, | 292 DBusClientImplementationType type, |
295 dbus::Bus* bus, | 293 dbus::Bus* bus, |
296 BluetoothAdapterClient* adapter_client) { | 294 BluetoothAdapterClient* adapter_client) { |
297 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 295 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
298 return new BluetoothInputClientImpl(bus, adapter_client); | 296 return new BluetoothInputClientImpl(bus, adapter_client); |
299 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 297 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
300 return new BluetoothInputClientStubImpl(); | 298 return new BluetoothInputClientStubImpl(); |
301 } | 299 } |
302 | 300 |
303 } // namespace chromeos | 301 } // namespace chromeos |
OLD | NEW |