Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: extensions/common/api/audio.idl

Issue 2605983002: Simplify logic behind chrome.audio.setActiveDevices (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/common/api/audio.idl
diff --git a/extensions/common/api/audio.idl b/extensions/common/api/audio.idl
index 36a1124bd3b66b81339248e984c368cb6b9e5885..9f7fe3a3db0e39e2816a85397cd32b789109030f 100644
--- a/extensions/common/api/audio.idl
+++ b/extensions/common/api/audio.idl
@@ -67,31 +67,56 @@ namespace audio {
double? gain;
};
+ dictionary DeviceIdLists {
+ // <p>IDs of all input devices that should be active.</p>
+ // <p>
+ // Only <b>existing input</b> device IDs will be accepted. If this is not
+ // the case, the method will fail without updating active devices.
+ // </p>
+ DOMString[]? input;
+
+ // <p>IDs of all output devices that should be active.</p>
+ // <p>
+ // Only <b>existing output</b> device IDs will be accepted. If this is not
+ // the case, the method will fail without updating active devices.
+ // </p>
+ DOMString[]? output;
+ };
+
callback GetInfoCallback = void(OutputDeviceInfo[] outputInfo,
InputDeviceInfo[] inputInfo);
- callback SetActiveDevicesCallback = void();
- callback SetPropertiesCallback = void();
+ callback EmptyCallback = void();
interface Functions {
// Gets the information of all audio output and input devices.
static void getInfo(GetInfoCallback callback);
- // Sets the active devices to the devices specified by |ids|.
- // It can pass in the "complete" active device id list of either input
- // devices, or output devices, or both. If only input device ids are passed
- // in, it will only change the input devices' active status, output devices will
- // NOT be changed; similarly for the case if only output devices are passed.
- // If the devices specified in |new_active_ids| are already active, they will
- // remain active. Otherwise, the old active devices will be de-activated
- // before we activate the new devices with the same type(input/output).
- static void setActiveDevices(DOMString[] ids,
- SetActiveDevicesCallback callback);
// Sets the properties for the input or output device.
static void setProperties(DOMString id,
DeviceProperties properties,
- SetPropertiesCallback callback);
- };
+ EmptyCallback callback);
+
+ // Sets lists of active input and/or output devices.
+ // |ids|: Specifies IDs of devices that should be active. The device IDs
+ // are split on basis of the device's audio stream type. If list
+ // for a particular stream direction is not set, set of active devices
+ // with that stream direction will not be affected.
+ static void setActiveDeviceLists(DeviceIdLists ids, EmptyCallback callback);
+
+ // Sets the active devices to the devices specified by |ids|.
+ // It can pass in the "complete" active device id list of either input
+ // devices, or output devices, or both. If only input device ids are passed
+ // in, it will only change the input devices' active status, output devices
+ // will *not* be changed; similarly for the case if only output devices are
+ // passed.
+ // If the devices specified in |new_active_ids| are already active, they
+ // will remain active. Otherwise, the old active devices will be
+ // de-activated before we activate the new devices with the same
+ // type(input/output).
+ [deprecated="Use $(ref:setActiveDeviceLists)"]
+ static void setActiveDevices(DOMString[] ids, EmptyCallback callback);
+ };
interface Events {
// Fired when anything changes to the audio device configuration.

Powered by Google App Engine
This is Rietveld 408576698