blob: 615887aad3b0ff1581af2f29d329dd1937c0462a [file] [log] [blame]
// chrome/common/plugin.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';
import {
WebPluginInfo as content_mojom_WebPluginInfo,
WebPluginInfoSpec as content_mojom_WebPluginInfoSpec
} from '../../content/public/common/webplugininfo.mojom.m.js';
import {
FilePath as mojoBase_mojom_FilePath,
FilePathSpec as mojoBase_mojom_FilePathSpec
} from '../../mojo/public/mojom/base/file_path.mojom.m.js';
import {
String16 as mojoBase_mojom_String16,
String16Spec as mojoBase_mojom_String16Spec
} from '../../mojo/public/mojom/base/string16.mojom.m.js';
import {
Origin as url_mojom_Origin,
OriginSpec as url_mojom_OriginSpec
} from '../../url/mojom/origin.mojom.m.js';
import {
Url as url_mojom_Url,
UrlSpec as url_mojom_UrlSpec
} from '../../url/mojom/url.mojom.m.js';
/**
* @const { {$: !mojo.internal.MojomType} }
*/
export const PluginStatusSpec = { $: mojo.internal.Enum() };
/**
* @enum {number}
*/
export const PluginStatus = {
kAllowed: 0,
kBlocked: 1,
kBlockedByPolicy: 2,
kDisabled: 3,
kNotFound: 4,
kPlayImportantContent: 5,
kUnauthorized: 6,
MIN_VALUE: 0,
MAX_VALUE: 6,
};
/**
* @implements {mojo.internal.interfaceSupport.PendingReceiver}
*/
export class PluginHostPendingReceiver {
/**
* @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, 'chrome.mojom.PluginHost', scope);
}
}
/** @interface */
export class PluginHostInterface {
/**
* @param { !mojoBase_mojom_FilePath } filePath
*/
couldNotLoadPlugin(filePath) {}
/**
* @param { !url_mojom_Url } url
*/
openPDF(url) {}
}
/**
* @implements { PluginHostInterface }
*/
export class PluginHostRemote {
/** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */
constructor(handle = undefined) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!PluginHostPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
PluginHostPendingReceiver,
handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!PluginHostPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !mojoBase_mojom_FilePath } filePath
*/
couldNotLoadPlugin(
filePath) {
this.proxy.sendMessage(
0,
PluginHost_CouldNotLoadPlugin_ParamsSpec.$,
null,
[
filePath
]);
}
/**
* @param { !url_mojom_Url } url
*/
openPDF(
url) {
this.proxy.sendMessage(
1,
PluginHost_OpenPDF_ParamsSpec.$,
null,
[
url
]);
}
}
/**
* An object which receives request messages for the PluginHost
* mojom interface. Must be constructed over an object which implements that
* interface.
*/
export class PluginHostReceiver {
/**
* @param {!PluginHostInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!PluginHostRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
PluginHost_CouldNotLoadPlugin_ParamsSpec.$,
null,
impl.couldNotLoadPlugin.bind(impl));
this.helper_internal_.registerHandler(
1,
PluginHost_OpenPDF_ParamsSpec.$,
null,
impl.openPDF.bind(impl));
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
}
export class PluginHost {
/**
* @return {!string}
*/
static get $interfaceName() {
return "chrome.mojom.PluginHost";
}
/**
* 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 {!PluginHostRemote}
*/
static getRemote() {
let remote = new PluginHostRemote;
remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
return remote;
}
}
/**
* An object which receives request messages for the PluginHost
* 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 PluginHostCallbackRouter {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.couldNotLoadPlugin =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
PluginHost_CouldNotLoadPlugin_ParamsSpec.$,
null,
this.couldNotLoadPlugin.createReceiverHandler(false /* expectsResponse */));
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.openPDF =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
1,
PluginHost_OpenPDF_ParamsSpec.$,
null,
this.openPDF.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 PluginAuthHostPendingReceiver {
/**
* @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, 'chrome.mojom.PluginAuthHost', scope);
}
}
/** @interface */
export class PluginAuthHostInterface {
/**
* @param { !mojoBase_mojom_String16 } name
* @param { !string } groupId
*/
blockedUnauthorizedPlugin(name, groupId) {}
}
/**
* @implements { PluginAuthHostInterface }
*/
export class PluginAuthHostRemote {
/** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */
constructor(handle = undefined) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!PluginAuthHostPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
PluginAuthHostPendingReceiver,
handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!PluginAuthHostPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !mojoBase_mojom_String16 } name
* @param { !string } groupId
*/
blockedUnauthorizedPlugin(
name,
groupId) {
this.proxy.sendMessage(
0,
PluginAuthHost_BlockedUnauthorizedPlugin_ParamsSpec.$,
null,
[
name,
groupId
]);
}
}
/**
* An object which receives request messages for the PluginAuthHost
* mojom interface. Must be constructed over an object which implements that
* interface.
*/
export class PluginAuthHostReceiver {
/**
* @param {!PluginAuthHostInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!PluginAuthHostRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginAuthHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginAuthHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
PluginAuthHost_BlockedUnauthorizedPlugin_ParamsSpec.$,
null,
impl.blockedUnauthorizedPlugin.bind(impl));
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
}
export class PluginAuthHost {
/**
* @return {!string}
*/
static get $interfaceName() {
return "chrome.mojom.PluginAuthHost";
}
/**
* 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 {!PluginAuthHostRemote}
*/
static getRemote() {
let remote = new PluginAuthHostRemote;
remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
return remote;
}
}
/**
* An object which receives request messages for the PluginAuthHost
* 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 PluginAuthHostCallbackRouter {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginAuthHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginAuthHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.blockedUnauthorizedPlugin =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
PluginAuthHost_BlockedUnauthorizedPlugin_ParamsSpec.$,
null,
this.blockedUnauthorizedPlugin.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 PluginInfoHostPendingReceiver {
/**
* @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, 'chrome.mojom.PluginInfoHost', scope);
}
}
/** @interface */
export class PluginInfoHostInterface {
/**
* @param { !url_mojom_Url } url
* @param { !url_mojom_Origin } origin
* @param { !string } mimeType
* @return {!Promise<{
pluginInfo: !PluginInfo,
* }>}
*/
getPluginInfo(url, origin, mimeType) {}
}
/**
* @implements { PluginInfoHostInterface }
*/
export class PluginInfoHostRemote {
/** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */
constructor(handle = undefined) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!PluginInfoHostPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
PluginInfoHostPendingReceiver,
handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!PluginInfoHostPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !url_mojom_Url } url
* @param { !url_mojom_Origin } origin
* @param { !string } mimeType
* @return {!Promise<{
pluginInfo: !PluginInfo,
* }>}
*/
getPluginInfo(
url,
origin,
mimeType) {
return this.proxy.sendMessage(
0,
PluginInfoHost_GetPluginInfo_ParamsSpec.$,
PluginInfoHost_GetPluginInfo_ResponseParamsSpec.$,
[
url,
origin,
mimeType
]);
}
}
/**
* An object which receives request messages for the PluginInfoHost
* mojom interface. Must be constructed over an object which implements that
* interface.
*/
export class PluginInfoHostReceiver {
/**
* @param {!PluginInfoHostInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!PluginInfoHostRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginInfoHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginInfoHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
PluginInfoHost_GetPluginInfo_ParamsSpec.$,
PluginInfoHost_GetPluginInfo_ResponseParamsSpec.$,
impl.getPluginInfo.bind(impl));
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
}
export class PluginInfoHost {
/**
* @return {!string}
*/
static get $interfaceName() {
return "chrome.mojom.PluginInfoHost";
}
/**
* 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 {!PluginInfoHostRemote}
*/
static getRemote() {
let remote = new PluginInfoHostRemote;
remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
return remote;
}
}
/**
* An object which receives request messages for the PluginInfoHost
* 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 PluginInfoHostCallbackRouter {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
PluginInfoHostRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!PluginInfoHostRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.getPluginInfo =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
PluginInfoHost_GetPluginInfo_ParamsSpec.$,
PluginInfoHost_GetPluginInfo_ResponseParamsSpec.$,
this.getPluginInfo.createReceiverHandler(true /* 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 PluginInfoSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginParamSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginHost_CouldNotLoadPlugin_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginHost_OpenPDF_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginAuthHost_BlockedUnauthorizedPlugin_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginInfoHost_GetPluginInfo_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const PluginInfoHost_GetPluginInfo_ResponseParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
mojo.internal.Struct(
PluginInfoSpec.$,
'PluginInfo',
[
mojo.internal.StructField(
'status', 0,
0,
PluginStatusSpec.$,
0,
false /* nullable */,
0,
),
mojo.internal.StructField(
'plugin', 8,
0,
content_mojom_WebPluginInfoSpec.$,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'actualMimeType', 16,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'groupIdentifier', 24,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'groupName', 32,
0,
mojoBase_mojom_String16Spec.$,
null,
false /* nullable */,
0,
),
],
[[0, 48],]);
/**
* @record
*/
export class PluginInfo {
constructor() {
/** @type { !PluginStatus } */
this.status;
/** @type { !content_mojom_WebPluginInfo } */
this.plugin;
/** @type { !string } */
this.actualMimeType;
/** @type { !string } */
this.groupIdentifier;
/** @type { !mojoBase_mojom_String16 } */
this.groupName;
}
}
mojo.internal.Struct(
PluginParamSpec.$,
'PluginParam',
[
mojo.internal.StructField(
'name', 0,
0,
mojoBase_mojom_String16Spec.$,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'value', 8,
0,
mojoBase_mojom_String16Spec.$,
null,
false /* nullable */,
0,
),
],
[[0, 24],]);
/**
* @record
*/
export class PluginParam {
constructor() {
/** @type { !mojoBase_mojom_String16 } */
this.name;
/** @type { !mojoBase_mojom_String16 } */
this.value;
}
}
mojo.internal.Struct(
PluginHost_CouldNotLoadPlugin_ParamsSpec.$,
'PluginHost_CouldNotLoadPlugin_Params',
[
mojo.internal.StructField(
'filePath', 0,
0,
mojoBase_mojom_FilePathSpec.$,
null,
false /* nullable */,
0,
),
],
[[0, 16],]);
/**
* @record
*/
export class PluginHost_CouldNotLoadPlugin_Params {
constructor() {
/** @type { !mojoBase_mojom_FilePath } */
this.filePath;
}
}
mojo.internal.Struct(
PluginHost_OpenPDF_ParamsSpec.$,
'PluginHost_OpenPDF_Params',
[
mojo.internal.StructField(
'url', 0,
0,
url_mojom_UrlSpec.$,
null,
false /* nullable */,
0,
),
],
[[0, 16],]);
/**
* @record
*/
export class PluginHost_OpenPDF_Params {
constructor() {
/** @type { !url_mojom_Url } */
this.url;
}
}
mojo.internal.Struct(
PluginAuthHost_BlockedUnauthorizedPlugin_ParamsSpec.$,
'PluginAuthHost_BlockedUnauthorizedPlugin_Params',
[
mojo.internal.StructField(
'name', 0,
0,
mojoBase_mojom_String16Spec.$,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'groupId', 8,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
],
[[0, 24],]);
/**
* @record
*/
export class PluginAuthHost_BlockedUnauthorizedPlugin_Params {
constructor() {
/** @type { !mojoBase_mojom_String16 } */
this.name;
/** @type { !string } */
this.groupId;
}
}
mojo.internal.Struct(
PluginInfoHost_GetPluginInfo_ParamsSpec.$,
'PluginInfoHost_GetPluginInfo_Params',
[
mojo.internal.StructField(
'url', 0,
0,
url_mojom_UrlSpec.$,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'origin', 8,
0,
url_mojom_OriginSpec.$,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'mimeType', 16,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
],
[[0, 32],]);
/**
* @record
*/
export class PluginInfoHost_GetPluginInfo_Params {
constructor() {
/** @type { !url_mojom_Url } */
this.url;
/** @type { !url_mojom_Origin } */
this.origin;
/** @type { !string } */
this.mimeType;
}
}
mojo.internal.Struct(
PluginInfoHost_GetPluginInfo_ResponseParamsSpec.$,
'PluginInfoHost_GetPluginInfo_ResponseParams',
[
mojo.internal.StructField(
'pluginInfo', 0,
0,
PluginInfoSpec.$,
null,
false /* nullable */,
0,
),
],
[[0, 16],]);
/**
* @record
*/
export class PluginInfoHost_GetPluginInfo_ResponseParams {
constructor() {
/** @type { !PluginInfo } */
this.pluginInfo;
}
}