// chrome/browser/ui/webui/drive_picker_host/untrusted/drive_picker_host_untrusted.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 { DrivePickerResultHandlerRemote as drivePickerHost_mojom_DrivePickerResultHandlerRemote } from './drive_picker_result_handler.mojom-webui.js';
import { ProtoWrapperSpec as mojoBase_mojom_ProtoWrapperSpec } from '//resources/mojo/mojo/public/mojom/base/proto_wrapper.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export class PageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'drive_picker_host_untrusted.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();
    }
    onConsentKitIframeMessage(messageWrapper) {
        this.proxy.sendMessage(885241339, PageHandler_OnConsentKitIframeMessage_ParamsSpec.$, null, [
            messageWrapper
        ], false);
    }
    onConsentKitPrivacyFlowResult(resultWrapper) {
        this.proxy.sendMessage(1018284743, PageHandler_OnConsentKitPrivacyFlowResult_ParamsSpec.$, null, [
            resultWrapper
        ], false);
    }
    onConsentKitError(errorMessage) {
        this.proxy.sendMessage(1609932284, PageHandler_OnConsentKitError_ParamsSpec.$, null, [
            errorMessage
        ], 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(885241339, PageHandler_OnConsentKitIframeMessage_ParamsSpec.$, null, impl.onConsentKitIframeMessage.bind(impl), false);
        this.helper_internal_.registerHandler(1018284743, PageHandler_OnConsentKitPrivacyFlowResult_ParamsSpec.$, null, impl.onConsentKitPrivacyFlowResult.bind(impl), false);
        this.helper_internal_.registerHandler(1609932284, PageHandler_OnConsentKitError_ParamsSpec.$, null, impl.onConsentKitError.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandler {
    static get $interfaceName() {
        return "drive_picker_host_untrusted.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_;
    onConsentKitIframeMessage;
    onConsentKitPrivacyFlowResult;
    onConsentKitError;
    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.onConsentKitIframeMessage =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(885241339, PageHandler_OnConsentKitIframeMessage_ParamsSpec.$, null, this.onConsentKitIframeMessage.createReceiverHandler(false /* expectsResponse */), false);
        this.onConsentKitPrivacyFlowResult =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1018284743, PageHandler_OnConsentKitPrivacyFlowResult_ParamsSpec.$, null, this.onConsentKitPrivacyFlowResult.createReceiverHandler(false /* expectsResponse */), false);
        this.onConsentKitError =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1609932284, PageHandler_OnConsentKitError_ParamsSpec.$, null, this.onConsentKitError.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 PagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'drive_picker_host_untrusted.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();
    }
    showDrivePicker(resultHandler, keys) {
        this.proxy.sendMessage(1230811117, Page_ShowDrivePicker_ParamsSpec.$, null, [
            resultHandler,
            keys
        ], false);
    }
    loadConsentKitUrl(consentKitUrl) {
        this.proxy.sendMessage(1706189929, Page_LoadConsentKitUrl_ParamsSpec.$, null, [
            consentKitUrl
        ], 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(1230811117, Page_ShowDrivePicker_ParamsSpec.$, null, impl.showDrivePicker.bind(impl), false);
        this.helper_internal_.registerHandler(1706189929, Page_LoadConsentKitUrl_ParamsSpec.$, null, impl.loadConsentKitUrl.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Page {
    static get $interfaceName() {
        return "drive_picker_host_untrusted.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_;
    showDrivePicker;
    loadConsentKitUrl;
    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.showDrivePicker =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1230811117, Page_ShowDrivePicker_ParamsSpec.$, null, this.showDrivePicker.createReceiverHandler(false /* expectsResponse */), false);
        this.loadConsentKitUrl =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1706189929, Page_LoadConsentKitUrl_ParamsSpec.$, null, this.loadConsentKitUrl.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 PageHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'drive_picker_host_untrusted.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(1281047200, 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(1281047200, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, impl.createPageHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandlerFactory {
    static get $interfaceName() {
        return "drive_picker_host_untrusted.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(1281047200, 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 class DrivePickerBridgePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'drive_picker_host_untrusted.mojom.DrivePickerBridge', scope);
    }
}
export class DrivePickerBridgeRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(DrivePickerBridgePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    showDrivePicker(resultHandler, keys) {
        this.proxy.sendMessage(1759933850, DrivePickerBridge_ShowDrivePicker_ParamsSpec.$, null, [
            resultHandler,
            keys
        ], false);
    }
    loadConsentKitUrl(consentKitUrl) {
        this.proxy.sendMessage(337953275, DrivePickerBridge_LoadConsentKitUrl_ParamsSpec.$, null, [
            consentKitUrl
        ], false);
    }
}
;
/**
 * An object which receives request messages for the DrivePickerBridge
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class DrivePickerBridgeReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(DrivePickerBridgeRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1759933850, DrivePickerBridge_ShowDrivePicker_ParamsSpec.$, null, impl.showDrivePicker.bind(impl), false);
        this.helper_internal_.registerHandler(337953275, DrivePickerBridge_LoadConsentKitUrl_ParamsSpec.$, null, impl.loadConsentKitUrl.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class DrivePickerBridge {
    static get $interfaceName() {
        return "drive_picker_host_untrusted.mojom.DrivePickerBridge";
    }
    /**
     * 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 DrivePickerBridgeRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the DrivePickerBridge
 * 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 DrivePickerBridgeCallbackRouter {
    helper_internal_;
    $;
    router_;
    showDrivePicker;
    loadConsentKitUrl;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(DrivePickerBridgeRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.showDrivePicker =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1759933850, DrivePickerBridge_ShowDrivePicker_ParamsSpec.$, null, this.showDrivePicker.createReceiverHandler(false /* expectsResponse */), false);
        this.loadConsentKitUrl =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(337953275, DrivePickerBridge_LoadConsentKitUrl_ParamsSpec.$, null, this.loadConsentKitUrl.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 DrivePickerKeysSpec = { $: {} };
export const PageHandler_OnConsentKitIframeMessage_ParamsSpec = { $: {} };
export const PageHandler_OnConsentKitPrivacyFlowResult_ParamsSpec = { $: {} };
export const PageHandler_OnConsentKitError_ParamsSpec = { $: {} };
export const Page_ShowDrivePicker_ParamsSpec = { $: {} };
export const Page_LoadConsentKitUrl_ParamsSpec = { $: {} };
export const PageHandlerFactory_CreatePageHandler_ParamsSpec = { $: {} };
export const DrivePickerBridge_ShowDrivePicker_ParamsSpec = { $: {} };
export const DrivePickerBridge_LoadConsentKitUrl_ParamsSpec = { $: {} };
mojo.internal.Struct(DrivePickerKeysSpec.$, 'DrivePickerKeys', [
    mojo.internal.StructField('oauthToken', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('apiKey', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('appId', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(PageHandler_OnConsentKitIframeMessage_ParamsSpec.$, 'PageHandler_OnConsentKitIframeMessage_Params', [
    mojo.internal.StructField('messageWrapper', 0, 0, mojoBase_mojom_ProtoWrapperSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_OnConsentKitPrivacyFlowResult_ParamsSpec.$, 'PageHandler_OnConsentKitPrivacyFlowResult_Params', [
    mojo.internal.StructField('resultWrapper', 0, 0, mojoBase_mojom_ProtoWrapperSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_OnConsentKitError_ParamsSpec.$, 'PageHandler_OnConsentKitError_Params', [
    mojo.internal.StructField('errorMessage', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_ShowDrivePicker_ParamsSpec.$, 'Page_ShowDrivePicker_Params', [
    mojo.internal.StructField('resultHandler', 0, 0, mojo.internal.InterfaceProxy(drivePickerHost_mojom_DrivePickerResultHandlerRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('keys', 8, 0, DrivePickerKeysSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(Page_LoadConsentKitUrl_ParamsSpec.$, 'Page_LoadConsentKitUrl_Params', [
    mojo.internal.StructField('consentKitUrl', 0, 0, url_mojom_UrlSpec.$, null, 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],]);
mojo.internal.Struct(DrivePickerBridge_ShowDrivePicker_ParamsSpec.$, 'DrivePickerBridge_ShowDrivePicker_Params', [
    mojo.internal.StructField('resultHandler', 0, 0, mojo.internal.InterfaceProxy(drivePickerHost_mojom_DrivePickerResultHandlerRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('keys', 8, 0, DrivePickerKeysSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(DrivePickerBridge_LoadConsentKitUrl_ParamsSpec.$, 'DrivePickerBridge_LoadConsentKitUrl_Params', [
    mojo.internal.StructField('consentKitUrl', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(PageHandlerRemote, PageCallbackRouter, (remote, receiver) => PageHandlerFactory.getRemote().createPageHandler(remote, receiver));
