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 3// found in the LICENSE file. 4 5#include "base/values.h" 6#include "chromeos/dbus/nfc_record_client.h" 7 8#ifndef DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ 9#define DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ 10 11namespace device { 12class NfcNdefRecord; 13} // namespace device; 14 15namespace chromeos { 16namespace nfc_ndef_record_utils { 17 18// Converts the NfcNdefRecord |record| to a dictionary that can be passed to 19// NfcDeviceClient::Push and NfcTagClient::Write and stores it in |out|. 20// Returns false, if an error occurs during conversion. 21bool NfcNdefRecordToDBusAttributes( 22 const device::NfcNdefRecord* record, 23 base::DictionaryValue* out); 24 25// Converts an NDEF record D-Bus properties structure to an NfcNdefRecord 26// instance by populating the instance passed in |out|. |out| must not be NULL 27// and must not be already populated. Returns false, if an error occurs during 28// conversion. 29bool RecordPropertiesToNfcNdefRecord( 30 const NfcRecordClient::Properties* properties, 31 device::NfcNdefRecord* out); 32 33} // namespace nfc_ndef_record_utils 34} // namespace chromeos 35 36#endif // DEVICE_NFC_CHROMEOS_NDEF_RECORD_UTILS_CHROMEOS_H_ 37