summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_nfc_adapter_client.h
diff options
context:
space:
mode:
authorarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 08:47:17 +0000
committerarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 08:47:17 +0000
commit20e38b8e9730ae28f077269d67e75a231bea7ca3 (patch)
tree24416175bfded4f8df6d13d99c8713df9caea7d3 /chromeos/dbus/fake_nfc_adapter_client.h
parentb826fa8f5432ba0e02306d9901aa584653130e0d (diff)
downloadchromium_src-20e38b8e9730ae28f077269d67e75a231bea7ca3.zip
chromium_src-20e38b8e9730ae28f077269d67e75a231bea7ca3.tar.gz
chromium_src-20e38b8e9730ae28f077269d67e75a231bea7ca3.tar.bz2
nfc: Implement device::NfcTagChromeOS.
Implemented device::NfcTag for the Chrome OS platform. With this patch, Chrome can now interact with remote NFC tags. BUG=316471 TEST=device_unittests Review URL: https://codereview.chromium.org/116143009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_nfc_adapter_client.h')
-rw-r--r--chromeos/dbus/fake_nfc_adapter_client.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/chromeos/dbus/fake_nfc_adapter_client.h b/chromeos/dbus/fake_nfc_adapter_client.h
index 6752458..0bd353a 100644
--- a/chromeos/dbus/fake_nfc_adapter_client.h
+++ b/chromeos/dbus/fake_nfc_adapter_client.h
@@ -60,22 +60,29 @@ class CHROMEOS_EXPORT FakeNfcAdapterClient : public NfcAdapterClient {
void SetAdapterPresent(bool present);
void SetSecondAdapterPresent(bool present);
- // Tells the FakeNfcAdapterClient to add the device with path |device_path|
- // to its list of devices exposed for |kAdapterPath0|, if it is not already in
+ // Tells the FakeNfcAdapterClient to add the device or tag with the given path
+ // to its corresponding list for |kAdapterPath0|, if it is not already in
// the list and promptly triggers a property changed signal. This method will
// also fail, if the polling property of the adapter is false and will set it
// to false on success.
void SetDevice(const dbus::ObjectPath& device_path);
+ void SetTag(const dbus::ObjectPath& tag_path);
- // Talls the FakeNfcAdapterClient to remove the device with path
- // |device_path| from its list of devices exposed for |kAdapterPath0|, if it
- // is in its list of devices. On success, this method will mark the polling
- // property of the adapter to true.
+ // Tells the FakeNfcAdapterClient to remove the device or tag with the given
+ // path from its corresponding list exposed for |kAdapterPath0|, if it
+ // is in the list. On success, this method will mark the polling property of
+ // the adapter to true.
void UnsetDevice(const dbus::ObjectPath& device_path);
+ void UnsetTag(const dbus::ObjectPath& tag_path);
// Sets a flag that determines whether FakeNfcAdapterClient should notify
- // FakeNfcDeviceClient to start a pairing simulation as a result of a call
- // to StartPollLoop(). This is enabled by default.
+ // FakeNfcDeviceClient or FakeNfcTagClient to start a pairing simulation as a
+ // result of a call to StartPollLoop(). This is enabled by default. If
+ // enabled, the first call to StartPollLoop, will initiate a tag pairing
+ // simulation. The simulation will alternate between device and tag pairing on
+ // each successive call to StartPollLoop. This behavior, which is meant for
+ // feature development based on fake classes, can be disabled to allow manual
+ // control for unit tests.
void EnablePairingOnPoll(bool enabled);
private:
@@ -98,6 +105,10 @@ class CHROMEOS_EXPORT FakeNfcAdapterClient : public NfcAdapterClient {
// StartPollLoop().
bool start_pairing_on_poll_;
+ // If true, device pairing will be simulated on the next call to
+ // StartPollLoop. Otherwise, tag pairing will be simulated.
+ bool device_pairing_;
+
DISALLOW_COPY_AND_ASSIGN(FakeNfcAdapterClient);
};