Disable firewall check. It takes signifficant time, need to be on FILE thread.
[chromium-blink-merge.git] / device / nfc / nfc_tag_chromeos.h
blob5e4a723eeda9ee4783bc46d1a9903716d9651fec
1 // Copyright 2014 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.
5 #ifndef DEVICE_NFC_NFC_TAG_CHROMEOS_H_
6 #define DEVICE_NFC_NFC_TAG_CHROMEOS_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/observer_list.h"
12 #include "chromeos/dbus/nfc_tag_client.h"
13 #include "dbus/object_path.h"
14 #include "device/nfc/nfc_tag.h"
16 namespace chromeos {
18 class NfcNdefTagTechnologyChromeOS;
20 // The NfcTagChromeOS class implements device::NfcTag for the Chrome OS
21 // platform.
22 class NfcTagChromeOS : public device::NfcTag,
23 public NfcTagClient::Observer {
24 public:
25 // device::NfcTag overrides.
26 virtual void AddObserver(device::NfcTag::Observer* observer) OVERRIDE;
27 virtual void RemoveObserver(device::NfcTag::Observer* observer) OVERRIDE;
28 virtual std::string GetIdentifier() const OVERRIDE;
29 virtual TagType GetType() const OVERRIDE;
30 virtual bool IsReadOnly() const OVERRIDE;
31 virtual device::NfcTag::Protocol GetSupportedProtocol() const OVERRIDE;
32 virtual device::NfcTagTechnology::TechnologyTypeMask
33 GetSupportedTechnologies() const OVERRIDE;
34 virtual bool IsReady() const OVERRIDE;
35 virtual device::NfcNdefTagTechnology* GetNdefTagTechnology() OVERRIDE;
37 // NfcTagClient::Observer overrides.
38 virtual void TagPropertyChanged(const dbus::ObjectPath& object_path,
39 const std::string& property_name) OVERRIDE;
40 virtual void TagPropertiesReceived(
41 const dbus::ObjectPath& object_path) OVERRIDE;
43 // Object path representing the remote tag object.
44 const dbus::ObjectPath& object_path() const { return object_path_; }
46 private:
47 friend class NfcAdapterChromeOS;
49 explicit NfcTagChromeOS(const dbus::ObjectPath& object_path);
50 virtual ~NfcTagChromeOS();
52 // Object path of the tag that we are currently tracking.
53 dbus::ObjectPath object_path_;
55 // Stores whether or not the initial set of properties have been received.
56 bool is_ready_;
58 // The NfcNdefTagTechnology instance that allows users to perform NDEF
59 // read and write on this tag.
60 scoped_ptr<NfcNdefTagTechnologyChromeOS> ndef_technology_;
62 // List of observers interested in event notifications from us.
63 ObserverList<device::NfcTag::Observer> observers_;
65 DISALLOW_COPY_AND_ASSIGN(NfcTagChromeOS);
68 } // namespace chromeos
70 #endif // DEVICE_NFC_NFC_TAG_CHROMEOS_H_