summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 01:03:30 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 01:03:30 +0000
commit7375e8b24e5c3bc64ff6c679a2cbe17397c9c431 (patch)
tree63fd9cbed94f7ba7a6fa87ab46e76a0056519c85 /dbus
parent1014b1a6ccd05cb913372e7712cd47801530a6a9 (diff)
downloadchromium_src-7375e8b24e5c3bc64ff6c679a2cbe17397c9c431.zip
chromium_src-7375e8b24e5c3bc64ff6c679a2cbe17397c9c431.tar.gz
chromium_src-7375e8b24e5c3bc64ff6c679a2cbe17397c9c431.tar.bz2
bluetooth: Create stub manager, adapter and device.
These stub classes are used when building Chrome on Linux with chromeos=1. They allow sufficient UI to work to show a Bluetooth adapter, enable and disable it, and show an unconnected fake device associated with it. This can be trivially extended to provide all manner of fake Bluetooth information for UI development. BUG=chromium-os:28555 TEST=out/Debug/chrome Change-Id: I7af28be76355fad735389aaf2fa499d0a8dfd76b Review URL: https://chromiumcodereview.appspot.com/10823301 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus')
-rw-r--r--dbus/property.cc7
-rw-r--r--dbus/property.h18
2 files changed, 20 insertions, 5 deletions
diff --git a/dbus/property.cc b/dbus/property.cc
index e8dfe5d..9289c86 100644
--- a/dbus/property.cc
+++ b/dbus/property.cc
@@ -29,9 +29,10 @@ void PropertyBase::Init(PropertySet* property_set, const std::string& name) {
// PropertySet implementation.
//
-PropertySet::PropertySet(ObjectProxy* object_proxy,
- const std::string& interface,
- PropertyChangedCallback property_changed_callback)
+PropertySet::PropertySet(
+ ObjectProxy* object_proxy,
+ const std::string& interface,
+ const PropertyChangedCallback& property_changed_callback)
: object_proxy_(object_proxy),
interface_(interface),
property_changed_callback_(property_changed_callback),
diff --git a/dbus/property.h b/dbus/property.h
index a3fb5ca..2d98b74 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -38,7 +38,7 @@
// dbus::Property<std::vector<std::string> > children;
//
// Properties(dbus::ObjectProxy* object_proxy,
-// PropertyChangedCallback callback)
+// const PropertyChangedCallback callback)
// : dbus::PropertySet(object_proxy, "com.example.DBus", callback) {
// RegisterProperty("Name", &name);
// RegisterProperty("Version", &version);
@@ -164,6 +164,11 @@ class PropertyBase {
// Implementation provided by specialization.
virtual void AppendSetValueToWriter(MessageWriter* writer) = 0;
+ // Method used by test and stub implementations of dbus::PropertySet::Set
+ // to replace the property value with the set value without using a
+ // dbus::MessageReader.
+ virtual void ReplaceValueWithSetValue() = 0;
+
protected:
// Retrieves the associated property set.
PropertySet* property_set() { return property_set_; }
@@ -203,7 +208,7 @@ class PropertySet {
// |property_changed_callback| specifies the callback for when properties
// are changed, this may be a NULL callback.
PropertySet(ObjectProxy* object_proxy, const std::string& interface,
- PropertyChangedCallback property_changed_callback);
+ const PropertyChangedCallback& property_changed_callback);
// Destructor; we don't hold on to any references or memory that needs
// explicit clean-up, but clang thinks we might.
@@ -377,6 +382,15 @@ class Property : public PropertyBase {
// Implementation provided by specialization.
virtual void AppendSetValueToWriter(MessageWriter* writer);
+ // Method used by test and stub implementations of dbus::PropertySet::Set
+ // to replace the property value with the set value without using a
+ // dbus::MessageReader.
+ virtual void ReplaceValueWithSetValue() { value_ = set_value_; }
+
+ // Method used by test and stub implementations to directly set the
+ // value of a property.
+ void ReplaceValue(const T& value) { value_ = value; }
+
private:
// Current cached value of the property.
T value_;