diff options
author | mcchou <mcchou@chromium.org> | 2014-12-04 15:10:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 23:12:35 +0000 |
commit | f37ffd7f2a6c72bbdeed3dffaa4a9ca7e844d7b2 (patch) | |
tree | f311d841fe6696e942daeb129ff21a2d1bcbe5c4 /chromeos/dbus/bluetooth_media_client.h | |
parent | ac0ec24aef7c5120ad808a99721e05b944130ebb (diff) | |
download | chromium_src-f37ffd7f2a6c72bbdeed3dffaa4a9ca7e844d7b2.zip chromium_src-f37ffd7f2a6c72bbdeed3dffaa4a9ca7e844d7b2.tar.gz chromium_src-f37ffd7f2a6c72bbdeed3dffaa4a9ca7e844d7b2.tar.bz2 |
chromeos/dbus: Add Observer interface to Media API.
This CL adds the Observer interface for handling the logic while
some changes are made to the Media objects being observed.
BUG=429016
Review URL: https://codereview.chromium.org/741943002
Cr-Commit-Position: refs/heads/master@{#306924}
Diffstat (limited to 'chromeos/dbus/bluetooth_media_client.h')
-rw-r--r-- | chromeos/dbus/bluetooth_media_client.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chromeos/dbus/bluetooth_media_client.h b/chromeos/dbus/bluetooth_media_client.h index 6a2c056..aba6c33 100644 --- a/chromeos/dbus/bluetooth_media_client.h +++ b/chromeos/dbus/bluetooth_media_client.h @@ -14,6 +14,7 @@ #include "chromeos/chromeos_export.h" #include "chromeos/dbus/dbus_client.h" #include "dbus/object_path.h" +#include "dbus/property.h" namespace chromeos { @@ -40,6 +41,19 @@ class CHROMEOS_EXPORT BluetoothMediaClient : public DBusClient { std::vector<uint8_t> capabilities; }; + class Observer { + public: + virtual ~Observer() {} + + // Called when the Media object with object path |object_path| is added to + // the system. + virtual void MediaAdded(const dbus::ObjectPath& object_path) {} + + // Called when the Media object with object path |object_path| is removed + // from the system. + virtual void MediaRemoved(const dbus::ObjectPath& object_path) {} + }; + ~BluetoothMediaClient() override; // The ErrorCallback is used by media API methods to indicate failure. @@ -48,6 +62,12 @@ class CHROMEOS_EXPORT BluetoothMediaClient : public DBusClient { typedef base::Callback<void(const std::string& error_name, const std::string& error_message)> ErrorCallback; + // Adds and removes observers for events on all Media objects. Check the + // |object_path| parameter of observer methods to determine which Media object + // is issuing the event. + virtual void AddObserver(Observer* observer) = 0; + virtual void RemoveObserver(Observer* observer) = 0; + // Registers a media endpoint to sender at the D-Bus object path // |endpoint_path|. |properties| specifies profile UUID which the endpoint is // for, Codec implemented by the endpoint and the Capabilities of the |