// chrome/browser/ui/webui/location_internals/location_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 { GeolocationInternalsPendingReceiver as device_mojom_GeolocationInternalsPendingReceiver } from './geolocation_internals.mojom-webui.js';
export class LocationInternalsHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'mojom.LocationInternalsHandler', scope);
    }
}
export class LocationInternalsHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(LocationInternalsHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    bindInternalsInterface(receiver) {
        this.proxy.sendMessage(1693829916, LocationInternalsHandler_BindInternalsInterface_ParamsSpec.$, null, [
            receiver
        ], false);
    }
}
;
/**
 * An object which receives request messages for the LocationInternalsHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class LocationInternalsHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(LocationInternalsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1693829916, LocationInternalsHandler_BindInternalsInterface_ParamsSpec.$, null, impl.bindInternalsInterface.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class LocationInternalsHandler {
    static get $interfaceName() {
        return "mojom.LocationInternalsHandler";
    }
    /**
     * 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 LocationInternalsHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the LocationInternalsHandler
 * 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 LocationInternalsHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    bindInternalsInterface;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(LocationInternalsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.bindInternalsInterface =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1693829916, LocationInternalsHandler_BindInternalsInterface_ParamsSpec.$, null, this.bindInternalsInterface.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 LocationInternalsHandler_BindInternalsInterface_ParamsSpec = { $: {} };
mojo.internal.Struct(LocationInternalsHandler_BindInternalsInterface_ParamsSpec.$, 'LocationInternalsHandler_BindInternalsInterface_Params', [
    mojo.internal.StructField('receiver', 0, 0, mojo.internal.InterfaceRequest(device_mojom_GeolocationInternalsPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
