blob: 121ff6d6dacbb00bb2d9fbee8b75e6755acd77bb [file] [log] [blame]
// content/common/dom_automation_controller.mojom-lite.js is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview
* @suppress {missingRequire}
*/
'use strict';
mojo.internal.exportModule('content.mojom');
/**
* @implements {mojo.internal.interfaceSupport.PendingReceiver}
* @export
*/
content.mojom.DomAutomationControllerHostPendingReceiver = class {
/**
* @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,
content.mojom.DomAutomationControllerHost.$interfaceName,
scope);
}
};
/**
* @export
* @implements { content.mojom.DomAutomationControllerHostInterface }
*/
content.mojom.DomAutomationControllerHostRemote = class {
/** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */
constructor(handle = undefined) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!content.mojom.DomAutomationControllerHostPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
content.mojom.DomAutomationControllerHostPendingReceiver,
handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!content.mojom.DomAutomationControllerHostPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !string } jsonString
*/
domOperationResponse(
jsonString) {
this.proxy.sendMessage(
0,
content.mojom.DomAutomationControllerHost_DomOperationResponse_ParamsSpec.$,
null,
[
jsonString
],
false);
}
};
/**
* An object which receives request messages for the DomAutomationControllerHost
* mojom interface. Must be constructed over an object which implements that
* interface.
*
* @export
*/
content.mojom.DomAutomationControllerHostReceiver = class {
/**
* @param {!content.mojom.DomAutomationControllerHostInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!content.mojom.DomAutomationControllerHostRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
content.mojom.DomAutomationControllerHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!content.mojom.DomAutomationControllerHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
content.mojom.DomAutomationControllerHost_DomOperationResponse_ParamsSpec.$,
null,
impl.domOperationResponse.bind(impl),
false);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
};
/**
* @export
*/
content.mojom.DomAutomationControllerHost = class {
/**
* @return {!string}
*/
static get $interfaceName() {
return "content.mojom.DomAutomationControllerHost";
}
/**
* 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 {!content.mojom.DomAutomationControllerHostRemote}
* @export
*/
static getRemote() {
let remote = new content.mojom.DomAutomationControllerHostRemote;
remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
return remote;
}
};
/**
* An object which receives request messages for the DomAutomationControllerHost
* 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
*/
content.mojom.DomAutomationControllerHostCallbackRouter = class {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
content.mojom.DomAutomationControllerHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!content.mojom.DomAutomationControllerHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.domOperationResponse =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
content.mojom.DomAutomationControllerHost_DomOperationResponse_ParamsSpec.$,
null,
this.domOperationResponse.createReceiverHandler(false /* expectsResponse */),
false);
/** @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.
* @export
*/
removeListener(id) {
return this.router_.removeListener(id);
}
};
/**
* @const { {$:!mojo.internal.MojomType}}
* @export
*/
content.mojom.DomAutomationControllerHost_DomOperationResponse_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
mojo.internal.Struct(
content.mojom.DomAutomationControllerHost_DomOperationResponse_ParamsSpec.$,
'DomAutomationControllerHost_DomOperationResponse_Params',
[
mojo.internal.StructField(
'jsonString', 0,
0,
mojo.internal.String,
null,
false, /* nullable */
0 /* minVersion */,
),
],
[[0, 16],]);
/** @record */
content.mojom.DomAutomationControllerHost_DomOperationResponse_Params = class {
constructor() {
/** @export { !string } */
this.jsonString;
}
};