| 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_device_client.h" | 5 #include "chromeos/dbus/nfc_device_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 "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return; | 104 return; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Create the arguments. | 107 // Create the arguments. |
| 108 dbus::MethodCall method_call(nfc_device::kNfcDeviceInterface, | 108 dbus::MethodCall method_call(nfc_device::kNfcDeviceInterface, |
| 109 nfc_device::kPush); | 109 nfc_device::kPush); |
| 110 dbus::MessageWriter writer(&method_call); | 110 dbus::MessageWriter writer(&method_call); |
| 111 dbus::MessageWriter array_writer(NULL); | 111 dbus::MessageWriter array_writer(NULL); |
| 112 dbus::MessageWriter dict_entry_writer(NULL); | 112 dbus::MessageWriter dict_entry_writer(NULL); |
| 113 writer.OpenArray("{sv}", &array_writer); | 113 writer.OpenArray("{sv}", &array_writer); |
| 114 for (DictionaryValue::Iterator iter(attributes); | 114 for (base::DictionaryValue::Iterator iter(attributes); |
| 115 !iter.IsAtEnd(); iter.Advance()) { | 115 !iter.IsAtEnd(); iter.Advance()) { |
| 116 array_writer.OpenDictEntry(&dict_entry_writer); | 116 array_writer.OpenDictEntry(&dict_entry_writer); |
| 117 dict_entry_writer.AppendString(iter.key()); | 117 dict_entry_writer.AppendString(iter.key()); |
| 118 nfc_client_helpers::AppendValueDataAsVariant(&dict_entry_writer, | 118 nfc_client_helpers::AppendValueDataAsVariant(&dict_entry_writer, |
| 119 iter.value()); | 119 iter.value()); |
| 120 array_writer.CloseContainer(&dict_entry_writer); | 120 array_writer.CloseContainer(&dict_entry_writer); |
| 121 } | 121 } |
| 122 writer.CloseContainer(&array_writer); | 122 writer.CloseContainer(&array_writer); |
| 123 | 123 |
| 124 object_proxy->CallMethodWithErrorCallback( | 124 object_proxy->CallMethodWithErrorCallback( |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 NfcDeviceClient::~NfcDeviceClient() { | 243 NfcDeviceClient::~NfcDeviceClient() { |
| 244 } | 244 } |
| 245 | 245 |
| 246 NfcDeviceClient* NfcDeviceClient::Create(NfcAdapterClient* adapter_client) { | 246 NfcDeviceClient* NfcDeviceClient::Create(NfcAdapterClient* adapter_client) { |
| 247 return new NfcDeviceClientImpl(adapter_client); | 247 return new NfcDeviceClientImpl(adapter_client); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace chromeos | 250 } // namespace chromeos |
| OLD | NEW |