OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/bluetooth_adapter_client.h" | 5 #include "chromeos/dbus/bluetooth_adapter_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "dbus/bus.h" | 9 #include "dbus/bus.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 BluetoothAdapterClient::Properties::~Properties() { | 44 BluetoothAdapterClient::Properties::~Properties() { |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 // The BluetoothAdapterClient implementation used in production. | 48 // The BluetoothAdapterClient implementation used in production. |
49 class BluetoothAdapterClientImpl | 49 class BluetoothAdapterClientImpl |
50 : public BluetoothAdapterClient, | 50 : public BluetoothAdapterClient, |
51 public dbus::ObjectManager::Interface { | 51 public dbus::ObjectManager::Interface { |
52 public: | 52 public: |
53 BluetoothAdapterClientImpl() : weak_ptr_factory_(this) {} | 53 BluetoothAdapterClientImpl() |
| 54 : object_manager_(NULL), weak_ptr_factory_(this) {} |
54 | 55 |
55 virtual ~BluetoothAdapterClientImpl() { | 56 virtual ~BluetoothAdapterClientImpl() { |
56 object_manager_->UnregisterInterface( | 57 object_manager_->UnregisterInterface( |
57 bluetooth_adapter::kBluetoothAdapterInterface); | 58 bluetooth_adapter::kBluetoothAdapterInterface); |
58 } | 59 } |
59 | 60 |
60 // BluetoothAdapterClient override. | 61 // BluetoothAdapterClient override. |
61 virtual void AddObserver(BluetoothAdapterClient::Observer* observer) | 62 virtual void AddObserver(BluetoothAdapterClient::Observer* observer) |
62 OVERRIDE { | 63 OVERRIDE { |
63 DCHECK(observer); | 64 DCHECK(observer); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 256 } |
256 | 257 |
257 BluetoothAdapterClient::~BluetoothAdapterClient() { | 258 BluetoothAdapterClient::~BluetoothAdapterClient() { |
258 } | 259 } |
259 | 260 |
260 BluetoothAdapterClient* BluetoothAdapterClient::Create() { | 261 BluetoothAdapterClient* BluetoothAdapterClient::Create() { |
261 return new BluetoothAdapterClientImpl; | 262 return new BluetoothAdapterClientImpl; |
262 } | 263 } |
263 | 264 |
264 } // namespace chromeos | 265 } // namespace chromeos |
OLD | NEW |