| 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 #ifndef CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 static const char kDeviceUriRecordPath[]; | 24 static const char kDeviceUriRecordPath[]; |
| 25 static const char kTagRecordPath[]; | 25 static const char kTagRecordPath[]; |
| 26 | 26 |
| 27 // Properties structure that provides fake behavior for D-Bus calls. | 27 // Properties structure that provides fake behavior for D-Bus calls. |
| 28 struct Properties : public NfcRecordClient::Properties { | 28 struct Properties : public NfcRecordClient::Properties { |
| 29 explicit Properties(const PropertyChangedCallback& callback); | 29 explicit Properties(const PropertyChangedCallback& callback); |
| 30 virtual ~Properties(); | 30 virtual ~Properties(); |
| 31 | 31 |
| 32 // dbus::PropertySet overrides. | 32 // dbus::PropertySet overrides. |
| 33 virtual void Get(dbus::PropertyBase* property, | 33 virtual void Get(dbus::PropertyBase* property, |
| 34 dbus::PropertySet::GetCallback callback) OVERRIDE; | 34 dbus::PropertySet::GetCallback callback) override; |
| 35 virtual void GetAll() OVERRIDE; | 35 virtual void GetAll() override; |
| 36 virtual void Set(dbus::PropertyBase* property, | 36 virtual void Set(dbus::PropertyBase* property, |
| 37 dbus::PropertySet::SetCallback callback) OVERRIDE; | 37 dbus::PropertySet::SetCallback callback) override; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 FakeNfcRecordClient(); | 40 FakeNfcRecordClient(); |
| 41 virtual ~FakeNfcRecordClient(); | 41 virtual ~FakeNfcRecordClient(); |
| 42 | 42 |
| 43 // NfcTagClient overrides. | 43 // NfcTagClient overrides. |
| 44 virtual void Init(dbus::Bus* bus) OVERRIDE; | 44 virtual void Init(dbus::Bus* bus) override; |
| 45 virtual void AddObserver(Observer* observer) OVERRIDE; | 45 virtual void AddObserver(Observer* observer) override; |
| 46 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 46 virtual void RemoveObserver(Observer* observer) override; |
| 47 virtual std::vector<dbus::ObjectPath> GetRecordsForDevice( | 47 virtual std::vector<dbus::ObjectPath> GetRecordsForDevice( |
| 48 const dbus::ObjectPath& device_path) OVERRIDE; | 48 const dbus::ObjectPath& device_path) override; |
| 49 virtual std::vector<dbus::ObjectPath> GetRecordsForTag( | 49 virtual std::vector<dbus::ObjectPath> GetRecordsForTag( |
| 50 const dbus::ObjectPath& tag_path) OVERRIDE; | 50 const dbus::ObjectPath& tag_path) override; |
| 51 virtual Properties* GetProperties( | 51 virtual Properties* GetProperties( |
| 52 const dbus::ObjectPath& object_path) OVERRIDE; | 52 const dbus::ObjectPath& object_path) override; |
| 53 | 53 |
| 54 // Adds or removes the fake record objects and notifies the observers. | 54 // Adds or removes the fake record objects and notifies the observers. |
| 55 void SetDeviceRecordsVisible(bool visible); | 55 void SetDeviceRecordsVisible(bool visible); |
| 56 void SetTagRecordsVisible(bool visible); | 56 void SetTagRecordsVisible(bool visible); |
| 57 | 57 |
| 58 // Modifies the contents of the tag record. |attributes| should be the | 58 // Modifies the contents of the tag record. |attributes| should be the |
| 59 // same as the argument to NfcTagClient::Write. Each field will be directly | 59 // same as the argument to NfcTagClient::Write. Each field will be directly |
| 60 // assigned to the underlying record based on the type property, with | 60 // assigned to the underlying record based on the type property, with |
| 61 // no validity checking. Invalid tag content can be passed here to test | 61 // no validity checking. Invalid tag content can be passed here to test |
| 62 // the case where the remote application returns an incorrectly formatted | 62 // the case where the remote application returns an incorrectly formatted |
| (...skipping 20 matching lines...) Expand all Loading... |
| 83 scoped_ptr<Properties> device_text_record_properties_; | 83 scoped_ptr<Properties> device_text_record_properties_; |
| 84 scoped_ptr<Properties> device_uri_record_properties_; | 84 scoped_ptr<Properties> device_uri_record_properties_; |
| 85 scoped_ptr<Properties> tag_record_properties_; | 85 scoped_ptr<Properties> tag_record_properties_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(FakeNfcRecordClient); | 87 DISALLOW_COPY_AND_ASSIGN(FakeNfcRecordClient); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace chromeos | 90 } // namespace chromeos |
| 91 | 91 |
| 92 #endif // CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ | 92 #endif // CHROMEOS_DBUS_FAKE_NFC_RECORD_CLIENT_H_ |
| OLD | NEW |