| // services/audio/public/mojom/device_notifications.mojom.m.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2020 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| import {mojo} from '../../../../mojo/public/js/bindings.js'; |
| |
| |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| */ |
| export class DeviceListenerPendingReceiver { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, 'audio.mojom.DeviceListener', scope); |
| } |
| } |
| |
| /** @interface */ |
| export class DeviceListenerInterface { |
| |
| /** |
| */ |
| |
| devicesChanged() {} |
| } |
| |
| /** |
| * @implements { DeviceListenerInterface } |
| */ |
| export class DeviceListenerRemote { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!DeviceListenerPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| DeviceListenerPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!DeviceListenerPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| */ |
| |
| devicesChanged() { |
| this.proxy.sendMessage( |
| 0, |
| DeviceListener_DevicesChanged_ParamsSpec.$, |
| null, |
| [ |
| ]); |
| } |
| } |
| |
| /** |
| * An object which receives request messages for the DeviceListener |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| */ |
| export class DeviceListenerReceiver { |
| /** |
| * @param {!DeviceListenerInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!DeviceListenerRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| DeviceListenerRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!DeviceListenerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| DeviceListener_DevicesChanged_ParamsSpec.$, |
| null, |
| impl.devicesChanged.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| } |
| |
| export class DeviceListener { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "audio.mojom.DeviceListener"; |
| } |
| |
| /** |
| * Returns a remote for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!DeviceListenerRemote} |
| */ |
| static getRemote() { |
| let remote = new DeviceListenerRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| } |
| |
| |
| /** |
| * An object which receives request messages for the DeviceListener |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| */ |
| export class DeviceListenerCallbackRouter { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| DeviceListenerRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!DeviceListenerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.devicesChanged = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| DeviceListener_DevicesChanged_ParamsSpec.$, |
| null, |
| this.devicesChanged.createReceiverHandler(false /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| } |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| */ |
| export class DeviceNotifierPendingReceiver { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, 'audio.mojom.DeviceNotifier', scope); |
| } |
| } |
| |
| /** @interface */ |
| export class DeviceNotifierInterface { |
| |
| /** |
| * @param { !DeviceListenerRemote } listener |
| */ |
| |
| registerListener(listener) {} |
| } |
| |
| /** |
| * @implements { DeviceNotifierInterface } |
| */ |
| export class DeviceNotifierRemote { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!DeviceNotifierPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| DeviceNotifierPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!DeviceNotifierPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !DeviceListenerRemote } listener |
| */ |
| |
| registerListener( |
| listener) { |
| this.proxy.sendMessage( |
| 0, |
| DeviceNotifier_RegisterListener_ParamsSpec.$, |
| null, |
| [ |
| listener |
| ]); |
| } |
| } |
| |
| /** |
| * An object which receives request messages for the DeviceNotifier |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| */ |
| export class DeviceNotifierReceiver { |
| /** |
| * @param {!DeviceNotifierInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!DeviceNotifierRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| DeviceNotifierRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!DeviceNotifierRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| DeviceNotifier_RegisterListener_ParamsSpec.$, |
| null, |
| impl.registerListener.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| } |
| |
| export class DeviceNotifier { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "audio.mojom.DeviceNotifier"; |
| } |
| |
| /** |
| * Returns a remote for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!DeviceNotifierRemote} |
| */ |
| static getRemote() { |
| let remote = new DeviceNotifierRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| } |
| |
| |
| /** |
| * An object which receives request messages for the DeviceNotifier |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| */ |
| export class DeviceNotifierCallbackRouter { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| DeviceNotifierRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!DeviceNotifierRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.registerListener = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| DeviceNotifier_RegisterListener_ParamsSpec.$, |
| null, |
| this.registerListener.createReceiverHandler(false /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| } |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const DeviceListener_DevicesChanged_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const DeviceNotifier_RegisterListener_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| DeviceListener_DevicesChanged_ParamsSpec.$, |
| 'DeviceListener_DevicesChanged_Params', |
| [ |
| ], |
| [[0, 8],]); |
| |
| |
| |
| /** |
| * @record |
| */ |
| export class DeviceListener_DevicesChanged_Params { |
| constructor() { |
| } |
| } |
| |
| |
| |
| mojo.internal.Struct( |
| DeviceNotifier_RegisterListener_ParamsSpec.$, |
| 'DeviceNotifier_RegisterListener_Params', |
| [ |
| mojo.internal.StructField( |
| 'listener', 0, |
| 0, |
| mojo.internal.InterfaceProxy(DeviceListenerRemote), |
| null, |
| false /* nullable */, |
| 0, |
| ), |
| ], |
| [[0, 16],]); |
| |
| |
| |
| /** |
| * @record |
| */ |
| export class DeviceNotifier_RegisterListener_Params { |
| constructor() { |
| /** @type { !DeviceListenerRemote } */ |
| this.listener; |
| } |
| } |
| |