summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_nfc_record_client.cc
diff options
context:
space:
mode:
authorarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 01:18:27 +0000
committerarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 01:18:27 +0000
commite98a522bf0e022f4c1929185eda49ff04d94253a (patch)
treee6aecfd38bce409afb5d3a6cf399e903e3fcc4e2 /chromeos/dbus/fake_nfc_record_client.cc
parentdb69676b2d172c0f1975b79650592e8d2ec53615 (diff)
downloadchromium_src-e98a522bf0e022f4c1929185eda49ff04d94253a.zip
chromium_src-e98a522bf0e022f4c1929185eda49ff04d94253a.tar.gz
chromium_src-e98a522bf0e022f4c1929185eda49ff04d94253a.tar.bz2
nfc: Add D-Bus client for NFC Record interface.
Implemented a D-Bus client for the org.neard.Record interface. This CL also improves the way the object proxies are managed, so that objects' life-time is managed correctly and the Added/Removed notifications are properly sent to observers while supporting multiple adapters, tags, and devices. BUG=304979 TEST=1. chromeos_unittests 2. Tested on an SCL3711 USB NFC adapter that records properties update properly, by looking at /var/log/chrome/chrome while running Chrome with --vmodule=*nfc*. Review URL: https://codereview.chromium.org/48713010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_nfc_record_client.cc')
-rw-r--r--chromeos/dbus/fake_nfc_record_client.cc62
1 files changed, 62 insertions, 0 deletions
diff --git a/chromeos/dbus/fake_nfc_record_client.cc b/chromeos/dbus/fake_nfc_record_client.cc
new file mode 100644
index 0000000..f71f675
--- /dev/null
+++ b/chromeos/dbus/fake_nfc_record_client.cc
@@ -0,0 +1,62 @@
+// 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 "chromeos/dbus/fake_nfc_record_client.h"
+
+#include "base/logging.h"
+
+// TODO(armansito): For now, this class doesn't do anything. Implement fake
+// behavior in conjunction with unit tests while implementing the src/device
+// layer.
+
+namespace chromeos {
+
+FakeNfcRecordClient::Properties::Properties(
+ const PropertyChangedCallback& callback)
+ : NfcRecordClient::Properties(NULL, callback) {
+}
+
+FakeNfcRecordClient::Properties::~Properties() {
+}
+
+void FakeNfcRecordClient::Properties::Get(
+ dbus::PropertyBase* property,
+ dbus::PropertySet::GetCallback callback) {
+ VLOG(1) << "Get " << property->name();
+ callback.Run(false);
+}
+
+void FakeNfcRecordClient::Properties::GetAll() {
+ VLOG(1) << "GetAll";
+}
+
+void FakeNfcRecordClient::Properties::Set(
+ dbus::PropertyBase* property,
+ dbus::PropertySet::SetCallback callback) {
+ VLOG(1) << "Set " << property->name();
+ callback.Run(false);
+}
+
+FakeNfcRecordClient::FakeNfcRecordClient() {
+ VLOG(1) << "Creating FakeNfcRecordClient";
+}
+
+FakeNfcRecordClient::~FakeNfcRecordClient() {
+}
+
+void FakeNfcRecordClient::Init(dbus::Bus* bus) {
+}
+
+void FakeNfcRecordClient::AddObserver(Observer* observer) {
+}
+
+void FakeNfcRecordClient::RemoveObserver(Observer* observer) {
+}
+
+FakeNfcRecordClient::Properties*
+FakeNfcRecordClient::GetProperties(const dbus::ObjectPath& object_path) {
+ return NULL;
+}
+
+} // namespace chromeos