// chrome/browser/contextual_tasks/contextual_tasks_internals.mojom-webui.ts 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 '//resources/mojo/mojo/public/js/bindings.js';
import { MojoBrowserProxyFactory } from '//resources/mojo/mojo_browser_proxy.js';
import { TabSelectionModeSpec as contextualTasks_mojom_TabSelectionModeSpec } from './contextual_tasks_types.mojom-webui.js';
import { TimeSpec as mojoBase_mojom_TimeSpec } from '//resources/mojo/mojo/public/mojom/base/time.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export class ContextualTasksInternalsPageHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'contextual_tasks_internals.mojom.ContextualTasksInternalsPageHandlerFactory', scope);
    }
}
export class ContextualTasksInternalsPageHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(ContextualTasksInternalsPageHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createPageHandler(page, handler) {
        this.proxy.sendMessage(1820990513, ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, [
            page,
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the ContextualTasksInternalsPageHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class ContextualTasksInternalsPageHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1820990513, ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, impl.createPageHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class ContextualTasksInternalsPageHandlerFactory {
    static get $interfaceName() {
        return "contextual_tasks_internals.mojom.ContextualTasksInternalsPageHandlerFactory";
    }
    /**
     * 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.
     */
    static getRemote() {
        let remote = new ContextualTasksInternalsPageHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the ContextualTasksInternalsPageHandlerFactory
 * 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 ContextualTasksInternalsPageHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createPageHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createPageHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1820990513, ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, this.createPageHandler.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export class ContextualTasksInternalsPageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'contextual_tasks_internals.mojom.ContextualTasksInternalsPageHandler', scope);
    }
}
export class ContextualTasksInternalsPageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(ContextualTasksInternalsPageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getRelevantContext(request) {
        return this.proxy.sendMessage(352011134, ContextualTasksInternalsPageHandler_GetRelevantContext_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParamsSpec.$, [
            request
        ], false);
    }
    setForcedEmbeddedPageHost(host) {
        this.proxy.sendMessage(1253835007, ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_ParamsSpec.$, null, [
            host
        ], false);
    }
    getForcedEmbeddedPageHost() {
        return this.proxy.sendMessage(1017738307, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParamsSpec.$, [], false);
    }
    getEligibilityState() {
        return this.proxy.sendMessage(1420964149, ContextualTasksInternalsPageHandler_GetEligibilityState_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the ContextualTasksInternalsPageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class ContextualTasksInternalsPageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(352011134, ContextualTasksInternalsPageHandler_GetRelevantContext_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParamsSpec.$, impl.getRelevantContext.bind(impl), false);
        this.helper_internal_.registerHandler(1253835007, ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_ParamsSpec.$, null, impl.setForcedEmbeddedPageHost.bind(impl), false);
        this.helper_internal_.registerHandler(1017738307, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParamsSpec.$, impl.getForcedEmbeddedPageHost.bind(impl), false);
        this.helper_internal_.registerHandler(1420964149, ContextualTasksInternalsPageHandler_GetEligibilityState_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParamsSpec.$, impl.getEligibilityState.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class ContextualTasksInternalsPageHandler {
    static get $interfaceName() {
        return "contextual_tasks_internals.mojom.ContextualTasksInternalsPageHandler";
    }
    /**
     * 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.
     */
    static getRemote() {
        let remote = new ContextualTasksInternalsPageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the ContextualTasksInternalsPageHandler
 * 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 ContextualTasksInternalsPageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getRelevantContext;
    setForcedEmbeddedPageHost;
    getForcedEmbeddedPageHost;
    getEligibilityState;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getRelevantContext =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(352011134, ContextualTasksInternalsPageHandler_GetRelevantContext_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParamsSpec.$, this.getRelevantContext.createReceiverHandler(true /* expectsResponse */), false);
        this.setForcedEmbeddedPageHost =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1253835007, ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_ParamsSpec.$, null, this.setForcedEmbeddedPageHost.createReceiverHandler(false /* expectsResponse */), false);
        this.getForcedEmbeddedPageHost =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1017738307, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParamsSpec.$, this.getForcedEmbeddedPageHost.createReceiverHandler(true /* expectsResponse */), false);
        this.getEligibilityState =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1420964149, ContextualTasksInternalsPageHandler_GetEligibilityState_ParamsSpec.$, ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParamsSpec.$, this.getEligibilityState.createReceiverHandler(true /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export class ContextualTasksInternalsPagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'contextual_tasks_internals.mojom.ContextualTasksInternalsPage', scope);
    }
}
export class ContextualTasksInternalsPageRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(ContextualTasksInternalsPagePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onLogMessageAdded(eventTime, sourceFile, sourceLine, message) {
        this.proxy.sendMessage(1788365486, ContextualTasksInternalsPage_OnLogMessageAdded_ParamsSpec.$, null, [
            eventTime,
            sourceFile,
            sourceLine,
            message
        ], false);
    }
}
;
/**
 * An object which receives request messages for the ContextualTasksInternalsPage
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class ContextualTasksInternalsPageReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1788365486, ContextualTasksInternalsPage_OnLogMessageAdded_ParamsSpec.$, null, impl.onLogMessageAdded.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class ContextualTasksInternalsPage {
    static get $interfaceName() {
        return "contextual_tasks_internals.mojom.ContextualTasksInternalsPage";
    }
    /**
     * 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.
     */
    static getRemote() {
        let remote = new ContextualTasksInternalsPageRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the ContextualTasksInternalsPage
 * 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 ContextualTasksInternalsPageCallbackRouter {
    helper_internal_;
    $;
    router_;
    onLogMessageAdded;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ContextualTasksInternalsPageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onLogMessageAdded =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1788365486, ContextualTasksInternalsPage_OnLogMessageAdded_ParamsSpec.$, null, this.onLogMessageAdded.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export const GetRelevantContextRequestSpec = { $: {} };
export const TabSpec = { $: {} };
export const GetRelevantContextResponseSpec = { $: {} };
export const EligibilityStateSpec = { $: {} };
export const ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_ParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetRelevantContext_ParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_ParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetEligibilityState_ParamsSpec = { $: {} };
export const ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParamsSpec = { $: {} };
export const ContextualTasksInternalsPage_OnLogMessageAdded_ParamsSpec = { $: {} };
mojo.internal.Struct(GetRelevantContextRequestSpec.$, 'GetRelevantContextRequest', [
    mojo.internal.StructField('query', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('tabSelectionMode', 8, 0, contextualTasks_mojom_TabSelectionModeSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('minModelScore', 12, 0, mojo.internal.Float, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(TabSpec.$, 'Tab', [
    mojo.internal.StructField('title', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('url', 8, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(GetRelevantContextResponseSpec.$, 'GetRelevantContextResponse', [
    mojo.internal.StructField('relevantTabs', 0, 0, mojo.internal.Array(TabSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(EligibilityStateSpec.$, 'EligibilityState', [
    mojo.internal.StructField('isEligible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isContextualTasksEnabled', 0, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isSignedIn', 0, 2, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('primaryAccountInCookieJar', 0, 3, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isAimAllowedByPolicy', 0, 4, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isAimEligible', 0, 5, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isCobrowseEligible', 0, 6, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isContextSharingEnabled', 0, 7, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isDefaultSearchEngineGoogle', 1, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_ParamsSpec.$, 'ContextualTasksInternalsPageHandlerFactory_CreatePageHandler_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(ContextualTasksInternalsPageRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(ContextualTasksInternalsPageHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetRelevantContext_ParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetRelevantContext_Params', [
    mojo.internal.StructField('request', 0, 0, GetRelevantContextRequestSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetRelevantContext_ResponseParams', [
    mojo.internal.StructField('response', 0, 0, GetRelevantContextResponseSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_ParamsSpec.$, 'ContextualTasksInternalsPageHandler_SetForcedEmbeddedPageHost_Params', [
    mojo.internal.StructField('host', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_Params', [], [[0, 8],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetForcedEmbeddedPageHost_ResponseParams', [
    mojo.internal.StructField('host', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetEligibilityState_ParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetEligibilityState_Params', [], [[0, 8],]);
mojo.internal.Struct(ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParamsSpec.$, 'ContextualTasksInternalsPageHandler_GetEligibilityState_ResponseParams', [
    mojo.internal.StructField('state', 0, 0, EligibilityStateSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(ContextualTasksInternalsPage_OnLogMessageAdded_ParamsSpec.$, 'ContextualTasksInternalsPage_OnLogMessageAdded_Params', [
    mojo.internal.StructField('eventTime', 0, 0, mojoBase_mojom_TimeSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('sourceFile', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('sourceLine', 16, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('message', 24, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(ContextualTasksInternalsPageHandlerRemote, ContextualTasksInternalsPageCallbackRouter, (remote, receiver) => ContextualTasksInternalsPageHandlerFactory.getRemote().createPageHandler(remote, receiver));
