diff options
Diffstat (limited to 'chromium/device/nfc/nfc_ndef_record_utils_chromeos.h')
-rw-r--r-- | chromium/device/nfc/nfc_ndef_record_utils_chromeos.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chromium/device/nfc/nfc_ndef_record_utils_chromeos.h b/chromium/device/nfc/nfc_ndef_record_utils_chromeos.h new file mode 100644 index 00000000000..2d96b97a323 --- /dev/null +++ b/chromium/device/nfc/nfc_ndef_record_utils_chromeos.h @@ -0,0 +1,36 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/values.h" +#include "chromeos/dbus/nfc_record_client.h" + +#ifndef DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ +#define DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ + +namespace device { +class NfcNdefRecord; +} // namespace device; + +namespace chromeos { +namespace nfc_ndef_record_utils { + +// Converts the NfcNdefRecord |record| to a dictionary that can be passed to +// NfcDeviceClient::Push and NfcTagClient::Write and stores it in |out|. +// Returns false, if an error occurs during conversion. +bool NfcNdefRecordToDBusAttributes( + const device::NfcNdefRecord* record, + base::DictionaryValue* out); + +// Converts an NDEF record D-Bus properties structure to an NfcNdefRecord +// instance by populating the instance passed in |out|. |out| must not be NULL +// and must not be already populated. Returns false, if an error occurs during +// conversion. +bool RecordPropertiesToNfcNdefRecord( + const NfcRecordClient::Properties* properties, + device::NfcNdefRecord* out); + +} // namespace nfc_ndef_record_utils +} // namespace chromeos + +#endif // DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ |