// chrome/browser/ui/webui/omnibox/aim_eligibility/aim_eligibility.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 { JSTimeSpec as mojoBase_mojom_JSTimeSpec } from '//resources/mojo/mojo/public/mojom/base/time.mojom-webui.js';
export const DisclaimerStateSpec = { $: mojo.internal.Enum() };
export var DisclaimerState;
(function (DisclaimerState) {
    DisclaimerState[DisclaimerState["MIN_VALUE"] = 0] = "MIN_VALUE";
    DisclaimerState[DisclaimerState["MAX_VALUE"] = 2] = "MAX_VALUE";
    DisclaimerState[DisclaimerState["kAccepted"] = 0] = "kAccepted";
    DisclaimerState[DisclaimerState["kNotAccepted"] = 1] = "kNotAccepted";
    DisclaimerState[DisclaimerState["kRestricted"] = 2] = "kRestricted";
})(DisclaimerState || (DisclaimerState = {}));
export class PagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'aim_eligibility.mojom.Page', scope);
    }
}
export class PageRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onEligibilityStateChanged(state) {
        this.proxy.sendMessage(509658237, Page_OnEligibilityStateChanged_ParamsSpec.$, null, [
            state
        ], false);
    }
    onDriveStatusChanged(status) {
        this.proxy.sendMessage(1599974764, Page_OnDriveStatusChanged_ParamsSpec.$, null, [
            status
        ], false);
    }
}
;
/**
 * An object which receives request messages for the Page
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(509658237, Page_OnEligibilityStateChanged_ParamsSpec.$, null, impl.onEligibilityStateChanged.bind(impl), false);
        this.helper_internal_.registerHandler(1599974764, Page_OnDriveStatusChanged_ParamsSpec.$, null, impl.onDriveStatusChanged.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Page {
    static get $interfaceName() {
        return "aim_eligibility.mojom.Page";
    }
    /**
     * 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 PageRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Page
 * 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 PageCallbackRouter {
    helper_internal_;
    $;
    router_;
    onEligibilityStateChanged;
    onDriveStatusChanged;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onEligibilityStateChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(509658237, Page_OnEligibilityStateChanged_ParamsSpec.$, null, this.onEligibilityStateChanged.createReceiverHandler(false /* expectsResponse */), false);
        this.onDriveStatusChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1599974764, Page_OnDriveStatusChanged_ParamsSpec.$, null, this.onDriveStatusChanged.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 PageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'aim_eligibility.mojom.PageHandler', scope);
    }
}
export class PageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getEligibilityState() {
        return this.proxy.sendMessage(1021481800, PageHandler_GetEligibilityState_ParamsSpec.$, PageHandler_GetEligibilityState_ResponseParamsSpec.$, [], false);
    }
    requestServerEligibilityForDebugging() {
        this.proxy.sendMessage(2066630691, PageHandler_RequestServerEligibilityForDebugging_ParamsSpec.$, null, [], false);
    }
    setEligibilityResponseForDebugging(base64EncodedResponse) {
        return this.proxy.sendMessage(358279562, PageHandler_SetEligibilityResponseForDebugging_ParamsSpec.$, PageHandler_SetEligibilityResponseForDebugging_ResponseParamsSpec.$, [
            base64EncodedResponse
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1021481800, PageHandler_GetEligibilityState_ParamsSpec.$, PageHandler_GetEligibilityState_ResponseParamsSpec.$, impl.getEligibilityState.bind(impl), false);
        this.helper_internal_.registerHandler(2066630691, PageHandler_RequestServerEligibilityForDebugging_ParamsSpec.$, null, impl.requestServerEligibilityForDebugging.bind(impl), false);
        this.helper_internal_.registerHandler(358279562, PageHandler_SetEligibilityResponseForDebugging_ParamsSpec.$, PageHandler_SetEligibilityResponseForDebugging_ResponseParamsSpec.$, impl.setEligibilityResponseForDebugging.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandler {
    static get $interfaceName() {
        return "aim_eligibility.mojom.PageHandler";
    }
    /**
     * 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 PageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandler
 * 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 PageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getEligibilityState;
    requestServerEligibilityForDebugging;
    setEligibilityResponseForDebugging;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getEligibilityState =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1021481800, PageHandler_GetEligibilityState_ParamsSpec.$, PageHandler_GetEligibilityState_ResponseParamsSpec.$, this.getEligibilityState.createReceiverHandler(true /* expectsResponse */), false);
        this.requestServerEligibilityForDebugging =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2066630691, PageHandler_RequestServerEligibilityForDebugging_ParamsSpec.$, null, this.requestServerEligibilityForDebugging.createReceiverHandler(false /* expectsResponse */), false);
        this.setEligibilityResponseForDebugging =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(358279562, PageHandler_SetEligibilityResponseForDebugging_ParamsSpec.$, PageHandler_SetEligibilityResponseForDebugging_ResponseParamsSpec.$, this.setEligibilityResponseForDebugging.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 PageHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'aim_eligibility.mojom.PageHandlerFactory', scope);
    }
}
export class PageHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createPageHandler(page, handler) {
        this.proxy.sendMessage(108481000, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, [
            page,
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(108481000, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, impl.createPageHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandlerFactory {
    static get $interfaceName() {
        return "aim_eligibility.mojom.PageHandlerFactory";
    }
    /**
     * 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 PageHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandlerFactory
 * 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 PageHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createPageHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        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(108481000, PageHandlerFactory_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 const DriveStatusSpec = { $: {} };
export const EligibilityStateSpec = { $: {} };
export const Page_OnEligibilityStateChanged_ParamsSpec = { $: {} };
export const Page_OnDriveStatusChanged_ParamsSpec = { $: {} };
export const PageHandler_GetEligibilityState_ParamsSpec = { $: {} };
export const PageHandler_GetEligibilityState_ResponseParamsSpec = { $: {} };
export const PageHandler_RequestServerEligibilityForDebugging_ParamsSpec = { $: {} };
export const PageHandler_SetEligibilityResponseForDebugging_ParamsSpec = { $: {} };
export const PageHandler_SetEligibilityResponseForDebugging_ResponseParamsSpec = { $: {} };
export const PageHandlerFactory_CreatePageHandler_ParamsSpec = { $: {} };
mojo.internal.Struct(DriveStatusSpec.$, 'DriveStatus', [
    mojo.internal.StructField('isDriveSupported', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isPecEligible', 0, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isIdentityMatch', 0, 2, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isIncognito', 0, 3, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isFeatureFlagEnabled', 0, 4, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isForceDriveDisclaimerAccepted', 0, 5, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isSearchContentSharingEnabled', 0, 6, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('disclaimerState', 4, 0, DisclaimerStateSpec.$, 0, 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('isEligibleByPolicy', 0, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isThirdPartyEligibleByPolicy', 0, 2, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isEligibleByDse', 0, 3, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isEligibleByServer', 0, 4, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isServerEligibilityEnabled', 0, 5, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('eligibilityResponseBase64Encoded', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('eligibilityResponseSource', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('eligibilityResponseAuthType', 24, 0, mojo.internal.String, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('searchboxConfigBase64UrlEncoded', 32, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('driveStatus', 40, 0, DriveStatusSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('lastUpdated', 48, 0, mojoBase_mojom_JSTimeSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 64],]);
mojo.internal.Struct(Page_OnEligibilityStateChanged_ParamsSpec.$, 'Page_OnEligibilityStateChanged_Params', [
    mojo.internal.StructField('state', 0, 0, EligibilityStateSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_OnDriveStatusChanged_ParamsSpec.$, 'Page_OnDriveStatusChanged_Params', [
    mojo.internal.StructField('status', 0, 0, DriveStatusSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_GetEligibilityState_ParamsSpec.$, 'PageHandler_GetEligibilityState_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_GetEligibilityState_ResponseParamsSpec.$, 'PageHandler_GetEligibilityState_ResponseParams', [
    mojo.internal.StructField('state', 0, 0, EligibilityStateSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_RequestServerEligibilityForDebugging_ParamsSpec.$, 'PageHandler_RequestServerEligibilityForDebugging_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_SetEligibilityResponseForDebugging_ParamsSpec.$, 'PageHandler_SetEligibilityResponseForDebugging_Params', [
    mojo.internal.StructField('base64EncodedResponse', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_SetEligibilityResponseForDebugging_ResponseParamsSpec.$, 'PageHandler_SetEligibilityResponseForDebugging_ResponseParams', [
    mojo.internal.StructField('success', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandlerFactory_CreatePageHandler_ParamsSpec.$, 'PageHandlerFactory_CreatePageHandler_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(PageRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(PageHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(PageHandlerRemote, PageCallbackRouter, (remote, receiver) => PageHandlerFactory.getRemote().createPageHandler(remote, receiver));
