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/nfc_adapter_client.h" | 5 #include "chromeos/dbus/nfc_adapter_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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 << " Property: " << property_name; | 184 << " Property: " << property_name; |
185 FOR_EACH_OBSERVER(NfcAdapterClient::Observer, observers_, | 185 FOR_EACH_OBSERVER(NfcAdapterClient::Observer, observers_, |
186 AdapterPropertyChanged(object_path, property_name)); | 186 AdapterPropertyChanged(object_path, property_name)); |
187 } | 187 } |
188 | 188 |
189 // We maintain a pointer to the bus to be able to request proxies for | 189 // We maintain a pointer to the bus to be able to request proxies for |
190 // new NFC adapters that appear. | 190 // new NFC adapters that appear. |
191 dbus::Bus* bus_; | 191 dbus::Bus* bus_; |
192 | 192 |
193 // List of observers interested in event notifications. | 193 // List of observers interested in event notifications. |
194 ObserverList<NfcAdapterClient::Observer> observers_; | 194 base::ObserverList<NfcAdapterClient::Observer> observers_; |
195 | 195 |
196 // Mapping from object paths to object proxies and properties structures that | 196 // Mapping from object paths to object proxies and properties structures that |
197 // were already created by us. | 197 // were already created by us. |
198 scoped_ptr<nfc_client_helpers::DBusObjectMap> object_map_; | 198 scoped_ptr<nfc_client_helpers::DBusObjectMap> object_map_; |
199 | 199 |
200 // The manager client that we listen to events notifications from. | 200 // The manager client that we listen to events notifications from. |
201 NfcManagerClient* manager_client_; | 201 NfcManagerClient* manager_client_; |
202 | 202 |
203 // Weak pointer factory for generating 'this' pointers that might live longer | 203 // Weak pointer factory for generating 'this' pointers that might live longer |
204 // than we do. | 204 // than we do. |
205 // Note: This should remain the last member so it'll be destroyed and | 205 // Note: This should remain the last member so it'll be destroyed and |
206 // invalidate its weak pointers before any other members are destroyed. | 206 // invalidate its weak pointers before any other members are destroyed. |
207 base::WeakPtrFactory<NfcAdapterClientImpl> weak_ptr_factory_; | 207 base::WeakPtrFactory<NfcAdapterClientImpl> weak_ptr_factory_; |
208 | 208 |
209 DISALLOW_COPY_AND_ASSIGN(NfcAdapterClientImpl); | 209 DISALLOW_COPY_AND_ASSIGN(NfcAdapterClientImpl); |
210 }; | 210 }; |
211 | 211 |
212 NfcAdapterClient::NfcAdapterClient() { | 212 NfcAdapterClient::NfcAdapterClient() { |
213 } | 213 } |
214 | 214 |
215 NfcAdapterClient::~NfcAdapterClient() { | 215 NfcAdapterClient::~NfcAdapterClient() { |
216 } | 216 } |
217 | 217 |
218 NfcAdapterClient* NfcAdapterClient::Create(NfcManagerClient* manager_client) { | 218 NfcAdapterClient* NfcAdapterClient::Create(NfcManagerClient* manager_client) { |
219 return new NfcAdapterClientImpl(manager_client); | 219 return new NfcAdapterClientImpl(manager_client); |
220 } | 220 } |
221 | 221 |
222 } // namespace chromeos | 222 } // namespace chromeos |
OLD | NEW |