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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "chromeos/dbus/fake_nfc_adapter_client.h" | |
15 #include "chromeos/dbus/nfc_manager_client.h" | 14 #include "chromeos/dbus/nfc_manager_client.h" |
16 #include "dbus/bus.h" | 15 #include "dbus/bus.h" |
17 #include "dbus/message.h" | 16 #include "dbus/message.h" |
18 #include "third_party/cros_system_api/dbus/service_constants.h" | 17 #include "third_party/cros_system_api/dbus/service_constants.h" |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 | 20 |
22 NfcAdapterClient::Properties::Properties( | 21 NfcAdapterClient::Properties::Properties( |
23 dbus::ObjectProxy* object_proxy, | 22 dbus::ObjectProxy* object_proxy, |
24 const PropertyChangedCallback& callback) | 23 const PropertyChangedCallback& callback) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 207 |
209 DISALLOW_COPY_AND_ASSIGN(NfcAdapterClientImpl); | 208 DISALLOW_COPY_AND_ASSIGN(NfcAdapterClientImpl); |
210 }; | 209 }; |
211 | 210 |
212 NfcAdapterClient::NfcAdapterClient() { | 211 NfcAdapterClient::NfcAdapterClient() { |
213 } | 212 } |
214 | 213 |
215 NfcAdapterClient::~NfcAdapterClient() { | 214 NfcAdapterClient::~NfcAdapterClient() { |
216 } | 215 } |
217 | 216 |
218 NfcAdapterClient* NfcAdapterClient::Create(DBusClientImplementationType type, | 217 NfcAdapterClient* NfcAdapterClient::Create(NfcManagerClient* manager_client) { |
219 NfcManagerClient* manager_client) { | 218 return new NfcAdapterClientImpl(manager_client); |
220 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | |
221 return new NfcAdapterClientImpl(manager_client); | |
222 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | |
223 return new FakeNfcAdapterClient(); | |
224 } | 219 } |
225 | 220 |
226 } // namespace chromeos | 221 } // namespace chromeos |
OLD | NEW |