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_record_client.h" | 5 #include "chromeos/dbus/nfc_record_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "chromeos/dbus/fake_nfc_record_client.h" | |
11 #include "chromeos/dbus/nfc_device_client.h" | 10 #include "chromeos/dbus/nfc_device_client.h" |
12 #include "chromeos/dbus/nfc_tag_client.h" | 11 #include "chromeos/dbus/nfc_tag_client.h" |
13 #include "dbus/bus.h" | 12 #include "dbus/bus.h" |
14 #include "third_party/cros_system_api/dbus/service_constants.h" | 13 #include "third_party/cros_system_api/dbus/service_constants.h" |
15 | 14 |
16 using chromeos::nfc_client_helpers::DBusObjectMap; | 15 using chromeos::nfc_client_helpers::DBusObjectMap; |
17 using chromeos::nfc_client_helpers::ObjectProxyTree; | 16 using chromeos::nfc_client_helpers::ObjectProxyTree; |
18 | 17 |
19 namespace chromeos { | 18 namespace chromeos { |
20 | 19 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 239 |
241 DISALLOW_COPY_AND_ASSIGN(NfcRecordClientImpl); | 240 DISALLOW_COPY_AND_ASSIGN(NfcRecordClientImpl); |
242 }; | 241 }; |
243 | 242 |
244 NfcRecordClient::NfcRecordClient() { | 243 NfcRecordClient::NfcRecordClient() { |
245 } | 244 } |
246 | 245 |
247 NfcRecordClient::~NfcRecordClient() { | 246 NfcRecordClient::~NfcRecordClient() { |
248 } | 247 } |
249 | 248 |
250 NfcRecordClient* NfcRecordClient::Create(DBusClientImplementationType type, | 249 NfcRecordClient* NfcRecordClient::Create(NfcDeviceClient* device_client, |
251 NfcDeviceClient* device_client, | |
252 NfcTagClient* tag_client) { | 250 NfcTagClient* tag_client) { |
253 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 251 return new NfcRecordClientImpl(device_client, tag_client); |
254 return new NfcRecordClientImpl(device_client, tag_client); | |
255 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | |
256 return new FakeNfcRecordClient(); | |
257 } | 252 } |
258 | 253 |
259 } // namespace chromeos | 254 } // namespace chromeos |
OLD | NEW |